requestPermissions method

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

Ask the user for permissions, using the PermissionRequester this client is configured with.

This is the one place in CAMS that talks to the OS permission dialogs. Requests are serialized: Android denies - without showing anything - any request made while another dialog is up, so two callers asking at once used to make dialogs "fail silently".

A failed requester is logged, not rethrown: callers re-check the actual permission status afterwards anyway, 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');
      }
    });