requestPermissions method

Future<bool?> requestPermissions({
  1. bool sound = false,
  2. bool alert = false,
  3. bool badge = false,
  4. bool provisional = false,
  5. bool critical = false,
  6. bool carPlay = false,
  7. bool providesAppNotificationSettings = false,
})

Requests the specified permission(s) from user and returns current permission status.

On iOS, the carPlay parameter requests permission to show notifications on CarPlay when connected to a compatible vehicle. This requires iOS 10.0+ and is only applicable to iOS devices.

Implementation

Future<bool?> requestPermissions({
  bool sound = false,
  bool alert = false,
  bool badge = false,
  bool provisional = false,
  bool critical = false,
  bool carPlay = false,
  bool providesAppNotificationSettings = false,
}) => _channel.invokeMethod<bool?>('requestPermissions', <String, bool>{
  'sound': sound,
  'alert': alert,
  'badge': badge,
  'provisional': provisional,
  'critical': critical,
  'carPlay': carPlay,
  'providesAppNotificationSettings': providesAppNotificationSettings,
});