AndroidFlutterLocalNotificationsPlugin class

Android implementation of the local notifications plugin.

Inheritance

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

areNotificationsEnabled() → Future<bool?>
Returns whether the app can post notifications.
cancel({required int id, String? tag}) → Future<void>
Cancel/remove the notification with the specified id.
cancelAll() → Future<void>
Cancels/removes all notifications. This applies to notifications that have been scheduled and those that have already been presented.
inherited
cancelAllPendingNotifications() → Future<void>
Cancels/removes all pending notifications.
inherited
canScheduleExactNotifications() → Future<bool?>
Returns whether the app can schedule exact notifications.
createNotificationChannel(AndroidNotificationChannel notificationChannel) → Future<void>
Creates a notification channel.
createNotificationChannelGroup(AndroidNotificationChannelGroup notificationChannelGroup) → Future<void>
Creates a notification channel group.
deleteNotificationChannel({required String channelId}) → Future<void>
Deletes the notification channel with the specified channelId.
deleteNotificationChannelGroup({required String groupId}) → Future<void>
Deletes the notification channel group with the specified groupId as well as all of the channels belonging to the group.
getActiveNotificationMessagingStyle({required int id, String? tag}) → Future<MessagingStyleInformation?>
Returns the messaging style information of an active notification shown by the application that hasn't been dismissed/removed.
getActiveNotifications() → Future<List<ActiveNotification>>
Returns the list of active notifications shown by the application that haven't been dismissed/removed.
inherited
getNotificationAppLaunchDetails() → Future<NotificationAppLaunchDetails?>
Returns info on if a notification had been used to launch the application.
inherited
getNotificationChannels() → Future<List<AndroidNotificationChannel>?>
Returns the list of all notification channels.
hasNotificationPolicyAccess() → Future<bool?>
Whether the app has access to notification policy.
initialize({required AndroidInitializationSettings settings, DidReceiveNotificationResponseCallback? onDidReceiveNotificationResponse, DidReceiveBackgroundNotificationResponseCallback? onDidReceiveBackgroundNotificationResponse}) → Future<bool>
Initializes the plugin.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
openAppNotificationSettings() → Future<bool?>
Opens the operating system notification settings screen for this app.
override
pendingNotificationRequests() → Future<List<PendingNotificationRequest>>
Returns a list of notifications pending to be delivered/shown
inherited
periodicallyShow({required int id, String? title, String? body, required RepeatInterval repeatInterval, AndroidNotificationDetails? notificationDetails, String? payload, AndroidScheduleMode scheduleMode = AndroidScheduleMode.exact}) → Future<void>
Periodically show a notification using the specified interval.
override
periodicallyShowWithDuration({required int id, String? title, String? body, required Duration repeatDurationInterval, AndroidNotificationDetails? notificationDetails, String? payload, AndroidScheduleMode scheduleMode = AndroidScheduleMode.exact}) → Future<void>
Periodically show a notification using the specified custom duration interval.
override
requestExactAlarmsPermission() → Future<bool?>
Requests the permission to schedule exact alarms.
requestFullScreenIntentPermission() → Future<bool?>
Requests the permission to send/use full-screen intents.
requestNotificationPolicyAccess() → Future<bool?>
Requests access to notification policy.
requestNotificationsPermission() → Future<bool?>
Requests the permission for sending notifications. Returns whether the permission was granted.
show({required int id, String? title, String? body, AndroidNotificationDetails? notificationDetails, String? payload}) → Future<void>
Show a notification with an optional payload that will be passed back to the app when a notification is tapped on.
override
startForegroundService({required int id, String? title, String? body, AndroidNotificationDetails? notificationDetails, String? payload, AndroidServiceStartType startType = AndroidServiceStartType.startSticky, Set<AndroidServiceForegroundType>? foregroundServiceTypes}) → Future<void>
Starts an Android foreground service with the given notification.
stopForegroundService() → Future<void>
Stops a foreground service.
toString() → String
A string representation of this object.
inherited
zonedSchedule({required int id, String? title, String? body, required TZDateTime scheduledDate, String? payload, DateTimeComponents? matchDateTimeComponents, AndroidNotificationDetails? notificationDetails, AndroidScheduleMode scheduleMode = AndroidScheduleMode.exact}) → Future<void>
Schedules a notification to be shown at the specified date and time relative to a specific time zone.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

registerWith() → void
Registers this implementation as the plugin instance.