requestPermission function

Future<bool> requestPermission(
  1. Permission permission
)

Implementation

Future<bool> requestPermission(Permission permission) async {
  PermissionStatus? status;
  try {
    status = await permission.request();
  } catch (e) {
    ZegoLoggerService.logInfo(
      'Exception: $permission permission not granted, $e',
      tag: 'uikit',
      subTag: 'permission',
    );
  }

  if (status != PermissionStatus.granted) {
    ZegoLoggerService.logInfo(
      'Error: $permission permission not granted, $status',
      tag: 'uikit',
      subTag: 'permission',
    );
    return false;
  }

  return true;
}