requestPermission method
- bool? alert = true,
- bool? announcement = false,
- bool? badge = true,
- bool? carPlay = false,
- bool? criticalAlert = false,
- bool? provisional = false,
- bool? sound = true,
override
Prompts the user for notification permissions.
On iOS, a dialog is shown requesting the users permission.
If provisional is set to true, silent notification permissions will be
automatically granted. When notifications are delivered to the device, the
user will be presented with an option to disable notifications, keep receiving
them silently or enable prominent notifications.
On Android, is it not required to call this method. If called however, a NotificationSettings class will be returned with NotificationSettings.authorizationStatus returning AuthorizationStatus.authorized.
On Web, a popup requesting the users permission is shown using the native browser API.
Implementation
@override
Future<NotificationSettings> requestPermission({
bool? alert = true,
bool? announcement = false,
bool? badge = true,
bool? carPlay = false,
bool? criticalAlert = false,
bool? provisional = false,
bool? sound = true,
}) {
return super.noSuchMethod(
Invocation.method(#requestPermission, [], {
#alert: alert,
#announcement: announcement,
#badge: badge,
#carPlay: carPlay,
#criticalAlert: criticalAlert,
#provisional: provisional,
#sound: sound,
}),
returnValue: Future.value(defaultNotificationSettings),
returnValueForMissingStub: Future.value(defaultNotificationSettings),
);
}