shouldShowRationaleToRequest method
Future<List<NotificationPermission> >
shouldShowRationaleToRequest({
- String? channelKey,
- List<
NotificationPermission> permissions = const [NotificationPermission.Badge, NotificationPermission.Alert, NotificationPermission.Sound, NotificationPermission.Vibration, NotificationPermission.Light],
override
Check if the app must show some rationale before request the user's consent. Returns the list of permissions that can only be changed via user's intervention.
Implementation
@override
Future<List<NotificationPermission>> shouldShowRationaleToRequest(
{String? channelKey,
List<NotificationPermission> permissions = const [
NotificationPermission.Badge,
NotificationPermission.Alert,
NotificationPermission.Sound,
NotificationPermission.Vibration,
NotificationPermission.Light
]}) async {
List<Object?> permissionList = _listPermissionToListString(permissions);
permissionList = await methodChannel.invokeMethod(
CHANNEL_METHOD_SHOULD_SHOW_RATIONALE, {
NOTIFICATION_CHANNEL_KEY: channelKey,
NOTIFICATION_PERMISSIONS: permissionList
});
return _listStringToListPermission(permissionList);
}