requestPermission static method

Future<bool> requestPermission(
  1. Permission permission
)

Implementation

static Future<bool> requestPermission(Permission permission) async {
  var status = await checkPermission(permission);
  if (status == PermissionStatus.granted) {
    return true;
  }
  var result =
      await _channel.invokeMethod<int>('requestPermission', <String, dynamic>{
    'permission': permission.toString(),
  });
  return result == 0;
}