requestPermissions method

Future<void> requestPermissions(
  1. List<Permission> permissions
)

Asks the user for permissions with the configured PermissionRequester.

CAMS sends its permission requests through here (the notification permission is asked by the NotificationManager itself). Requests are queued and run one at a time: Android denies, without showing anything, any request made while another dialog is up.

A failing requester is logged, not rethrown. Callers re-check the actual permission status afterwards, and an error must not block the requests queued behind it.

Implementation

Future<void> requestPermissions(List<Permission> permissions) => _asking = _asking.then((_) async {
  try {
    await _permissionRequester(permissions);
  } catch (error) {
    warning('$runtimeType - Permission requester failed - $error');
  }
});