askForAllPermissions method

Future<void> askForAllPermissions()

Asking for all permissions needed for the included sampling packages.

Should be called before sensing is started, if not already done as part of configure.

Implementation

Future<void> askForAllPermissions() async {
  if (SamplingPackageRegistry().permissions.isNotEmpty) {
    info('Asking for permission for all measure types.');
    permissions = await SamplingPackageRegistry().permissions.request();

    for (var permission in SamplingPackageRegistry().permissions) {
      PermissionStatus status = await permission.status;
      info('Permissions for $permission : $status');
    }
  }
}