grantPermissionOnlyThisTime method

Future<void> grantPermissionOnlyThisTime()

Grants the permission that the currently visible native permission request dialog is asking for.

Throws if no permission request dialog is present.

On iOS, this is the same as grantPermissionWhenInUse except for the location permission.

On Android versions older than 11 (R, API level 30), the concept of "one-time permissions" doesn't exist. In this case, this method is the same as grantPermissionWhenInUse.

See also:

Implementation

Future<void> grantPermissionOnlyThisTime() async {
  await _wrapRequest(
    'grantPermissionOnlyThisTime',
    () => _client.handlePermissionDialog(
      HandlePermissionRequest(
        code: HandlePermissionRequestCode.onlyThisTime,
      ),
    ),
  );
}