flutter_local_notifications 1.1.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 100

Flutter Local Notifications Plugin #

pub package Build Status

A cross platform plugin for displaying local notifications.

Supported Platforms #

  • Android API 16+ (4.1+, the minimum version supported by Flutter). Uses the NotificationCompat APIs so it can be run older Android devices
  • iOS 8.0+ (the minimum version supported by Flutter). Supports the old and new iOS notification APIs (the User Notifications Framework introduced in iOS 10 but will use the UILocalNotification APIs for devices predating iOS 10)

Features #

  • Mockable (plugin and API methods aren't static)
  • Display basic notifications
  • Scheduling when notifications should appear
  • Periodically show a notification (interval based)
  • Schedule a notification to be shown daily at a specified time
  • Schedule a notification to be shown weekly on a specified day and time
  • Retrieve a list of pending notification requests that have been scheduled to be shown in the future
  • Cancelling/removing notification by id or all of them
  • Specify a custom notification sound
  • Ability to handle when a user has tapped on a notification, when the app is the foreground, background or terminated
  • Determine if an app was launched due to tapping on a notification
  • [Android] Configuring the importance level
  • [Android] Configuring the priority
  • [Android] Customising the vibration pattern for notifications
  • [Android] Configure the default icon for all notifications
  • [Android] Configure the icon for each notification (overrides the default when specified)
  • [Android] Configure the large icon for each notification. The icon can be a drawable or a file on the device
  • [Android] Formatting notification content via HTML markup (see https://developer.android.com/guide/topics/resources/string-resource.html#StylingWithHTML)
  • [Android] Support for the following notification styles
    • Big picture
    • Big text
    • Inbox
    • Messaging
    • Media
      • While media playback control using a MediaSession.Token is not supported, with this style you let Android treat the largeIcon bitmap as album artwork
  • [Android] Group notifications
  • [Android] Show progress notifications
  • [Android] Configure notification visibility on the lockscreen
  • [iOS] Customise the permissions to be requested around displaying notifications

Note that this plugin aims to provide abstractions for all platforms as opposed to having methods that only work on specific platforms. However, each method allows passing in "platform-specifics" that contains data that is specific for customising notifications on each platform. This approach means that some scenarios may not be covered by the plugin. Developers can either fork or maintain their code for showing notifications in these situations. Note that the plugin still under development so expect the API surface to change over time.


  • Recurring notifications on Android use the Alarm Manager API. This is standard practice but does mean the delivery of the notifications/alarms are inexact and this is documented Android behaviour as per the previous link. Note that it's been reported that Samsung's implementation of Android has imposed a maximum of 500 alarms that can be scheduled via this API and exceptions can occur when going over the limit
  • iOS has a limit on how many pending notifications it allows. This is a limit imposed by iOS where it will only keep 64 notifications that will fire the soonest
  • Known issue: There is a known issue with handling daylight savings for scheduled notifications. This functionality may be deprecated to be replaced by another that only deals with elapsed time since epoch instead of a date.

Acknowledgements #

  • Javier Lecuona for submitting the PR that added the ability to have notifications shown daily
  • Jeff Scaturro for submitting the PR to fix the iOS issue around showing daily and weekly notifications and migrating the plugin to AndroidX
  • Ian Cavanaugh for helping create a sample to reproduce the problem reported in issue #88
  • Zhang Jing for adding 'ticker' support for Android notifications
  • ...and everyone else for their contributions. They are greatly appreciated

Raising issues and contributions #

If you run into issues, please raise them on the GitHub repository. Please do not email them to me as GitHub is the appropriate place for them and allows for members of the community to answer questions, particularly if I miss the email. It would also be much appreciated if they could be limited to actual bugs or feature requests. If you're looking at how you could use the plugin to do a particular kind of notification, check the example app provides detailed code samples for each supported feature. Also try to check the README first in case you have missed something e.g. platform-specific setup.

Contributions are welcome by submitting a PR for me to review. If it's to add new features, appreciate it if you could try to maintain the architecture or try to improve on it. However, do note that I will not take PRs that add methods at the Dart level that don't work on all platforms. However, platform-specific configuration through the use parameters are fine as that's approach being taken via this plugin.

Getting Started #

The GitHub repository has an example app that should demonstrate of all the supported features of the plugin. Please check the example for more detailed code samples. If you only copy and paste the Dart code then this will not work as there's setup required for each platform. Pub also generates API docs for the latest version here. Besides referring to the example app and getting started section, please ensure that you have performed the steps in the integration guide for each platform further below.

The following samples will demonstrate the more commonly used functionalities. The first step is to create a new instance of the plugin class and then initialise it with the settings to use for each platform

FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin = new FlutterLocalNotificationsPlugin();
// initialise the plugin. app_icon needs to be a added as a drawable resource to the Android head project
var initializationSettingsAndroid =
    new AndroidInitializationSettings('app_icon');
var initializationSettingsIOS = IOSInitializationSettings(
    onDidReceiveLocalNotification: onDidReceiveLocalNotification);
var initializationSettings = InitializationSettings(
    initializationSettingsAndroid, initializationSettingsIOS);
    onSelectNotification: onSelectNotification);

Initialisation should only be done once and the place where this can be done is in the main function of the your application. Alternatively, this can be done within the first page shown in your app. Developers should look at the example app, which does the initialisation within the main function as the code below is simplified for explaining the concepts. Here we specify we have specified the default icon to use for notifications on Android (refer to the Android Integration section) and designated the function (onSelectNotification) that should fire when a notification has been tapped on. Specifying this callback is entirely optional. In this example, it will trigger navigation to another page and display the payload associated with the notification.

Future onSelectNotification(String payload) async {
    if (payload != null) {
      debugPrint('notification payload: ' + payload);
    await Navigator.push(
      new MaterialPageRoute(builder: (context) => new SecondScreen(payload)),

In the real world, this payload could represent the id of the item you want to display the details of. Once the initialisation has been done, then you can manage the displaying of notifications.

Notes around initialisation: if the app had been launched by tapping on a notification created by this plugin, calling initialize is what will trigger the onSelectNotification to trigger to handle the notification that the user tapped on. An alternative to handling the "launch notification" is to call the getNotificationAppLaunchDetails method that is available in the plugin. This could be used, for example, to change the home route of the app for deep-linking. Calling initialize will still cause the onSelectNotification callback to fire for the launch notification. It will be up to developers to ensure that they don't process the same notification twice (e.g. by storing and comparing the notification id).

Displaying a notification #

var androidPlatformChannelSpecifics = AndroidNotificationDetails(
    'your channel id', 'your channel name', 'your channel description',
    importance: Importance.Max, priority: Priority.High, ticker: 'ticker');
var iOSPlatformChannelSpecifics = IOSNotificationDetails();
var platformChannelSpecifics = NotificationDetails(
    androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics);
await flutterLocalNotificationsPlugin.show(
    0, 'plain title', 'plain body', platformChannelSpecifics,
    payload: 'item x');

In this block of code, the details for each platform have been specified. This includes the channel details that is required for Android 8.0+. The payload has been specified ('item x'), that will passed back through your application when the user has tapped on a notification. Note that for Android devices that notifications will only in appear in the tray and won't appear as a toast aka heads-up notification unless things like the priority/importance has been set appropriately. Refer to the Android docs (https://developer.android.com/guide/topics/ui/notifiers/notifications.html#Heads-up) for additional information. Note that the "ticker" text is passed here though it is optional and specific to Android. This allows for text to be shown in the status bar on older versions of Android when the notification is shown.

Scheduling a notification #

var scheduledNotificationDateTime =
        new DateTime.now().add(new Duration(seconds: 5));
var androidPlatformChannelSpecifics =
    new AndroidNotificationDetails('your other channel id',
        'your other channel name', 'your other channel description');
var iOSPlatformChannelSpecifics =
    new IOSNotificationDetails();
NotificationDetails platformChannelSpecifics = new NotificationDetails(
    androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics);
await flutterLocalNotificationsPlugin.schedule(
    'scheduled title',
    'scheduled body',

Note that on Android devices, the default behaviour is that the notification may not be delivered at the specified time when the device in a low-power idle mode. This behaviour can be changed by setting the optional parameter named androidAllowWhileIdle to true when calling the schedule method.

Periodically show a notification with a specified interval #

// Show a notification every minute with the first appearance happening a minute after invoking the method
var androidPlatformChannelSpecifics =
    new AndroidNotificationDetails('repeating channel id',
        'repeating channel name', 'repeating description');
var iOSPlatformChannelSpecifics =
    new IOSNotificationDetails();
var platformChannelSpecifics = new NotificationDetails(
    androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics);
await flutterLocalNotificationsPlugin.periodicallyShow(0, 'repeating title',
    'repeating body', RepeatInterval.EveryMinute, platformChannelSpecifics);

Show a daily notification at a specific time #

var time = new Time(10, 0, 0);
var androidPlatformChannelSpecifics =
    new AndroidNotificationDetails('repeatDailyAtTime channel id',
        'repeatDailyAtTime channel name', 'repeatDailyAtTime description');
var iOSPlatformChannelSpecifics =
    new IOSNotificationDetails();
var platformChannelSpecifics = new NotificationDetails(
    androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics);
await flutterLocalNotificationsPlugin.showDailyAtTime(
    'show daily title',
    'Daily notification shown at approximately ${_toTwoDigitString(time.hour)}:${_toTwoDigitString(time.minute)}:${_toTwoDigitString(time.second)}',

Show a weekly notification on specific day and time #

var time = new Time(10, 0, 0);
var androidPlatformChannelSpecifics =
    new AndroidNotificationDetails('show weekly channel id',
        'show weekly channel name', 'show weekly description');
var iOSPlatformChannelSpecifics =
    new IOSNotificationDetails();
var platformChannelSpecifics = new NotificationDetails(
    androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics);
await flutterLocalNotificationsPlugin.showWeeklyAtDayAndTime(
    'show weekly title',
    'Weekly notification shown on Monday at approximately ${_toTwoDigitString(time.hour)}:${_toTwoDigitString(time.minute)}:${_toTwoDigitString(time.second)}',

Retrieve pending notification requests #

var pendingNotificationRequests =
        await flutterLocalNotificationsPlugin.pendingNotificationRequests();

[Android only] Grouping notifications

This is a "translation" of the sample available at https://developer.android.com/training/notify-user/group.html For iOS, you could just display the summary notification (not shown in the example) as otherwise the following code would show three notifications

String groupKey = 'com.android.example.WORK_EMAIL';
String groupChannelId = 'grouped channel id';
String groupChannelName = 'grouped channel name';
String groupChannelDescription = 'grouped channel description';
// example based on https://developer.android.com/training/notify-user/group.html
AndroidNotificationDetails firstNotificationAndroidSpecifics =
    new AndroidNotificationDetails(
        groupChannelId, groupChannelName, groupChannelDescription,
        importance: Importance.Max,
        priority: Priority.High,
        groupKey: groupKey);
NotificationDetails firstNotificationPlatformSpecifics =
    new NotificationDetails(firstNotificationAndroidSpecifics, null);
await flutterLocalNotificationsPlugin.show(1, 'Alex Faarborg',
    'You will not believe...', firstNotificationPlatformSpecifics);
AndroidNotificationDetails secondNotificationAndroidSpecifics =
    new AndroidNotificationDetails(
        groupChannelId, groupChannelName, groupChannelDescription,
        importance: Importance.Max,
        priority: Priority.High,
        groupKey: groupKey);
NotificationDetails secondNotificationPlatformSpecifics =
    new NotificationDetails(secondNotificationAndroidSpecifics, null);
await flutterLocalNotificationsPlugin.show(
    'Jeff Chang',
    'Please join us to celebrate the...',

// create the summary notification required for older devices that pre-date Android 7.0 (API level 24)
List<String> lines = new List<String>();
lines.add('Alex Faarborg  Check this out');
lines.add('Jeff Chang    Launch Party');
InboxStyleInformation inboxStyleInformation = new InboxStyleInformation(
    contentTitle: '2 new messages',
    summaryText: 'janedoe@example.com');
AndroidNotificationDetails androidPlatformChannelSpecifics =
    new AndroidNotificationDetails(
        groupChannelId, groupChannelName, groupChannelDescription,
        style: NotificationStyleAndroid.Inbox,
        styleInformation: inboxStyleInformation,
        groupKey: groupKey,
        setAsGroupSummary: true);
NotificationDetails platformChannelSpecifics =
    new NotificationDetails(androidPlatformChannelSpecifics, null);
await flutterLocalNotificationsPlugin.show(
    3, 'Attention', 'Two new messages', platformChannelSpecifics);

Cancelling/deleting a notification #

// cancel the notification with id value of zero
await flutterLocalNotificationsPlugin.cancel(0);

Cancelling/deleting all notifications #

await flutterLocalNotificationsPlugin.cancelAll();

Get details on if the app was launched via a notification #

 var notificationAppLaunchDetails =
     await flutterLocalNotificationsPlugin.getNotificationAppLaunchDetails();

This should cover the basic functionality. Please check out the example directory for a sample app that illustrates the rest of the functionality available and refer to the API docs for more information. Also read the below on what you need to configure on each platform

Android Integration #

If your application needs the ability to schedule notifications then you need to request permissions to be notified when the phone has been booted as scheduled notifications uses the AlarmManager API to determine when notifications should be displayed. However, they are cleared when a phone has been turned off. Requesting permission requires adding the following to the manifest

<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>

The following is also needed to ensure scheduled notifications remain scheduled upon a reboot (this is handled by the plugin)

<receiver android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationBootReceiver">
        <action android:name="android.intent.action.BOOT_COMPLETED"></action>

Developers will also need to add the following so that plugin can handle displaying scheduled notifications

<receiver android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationReceiver" />

If the vibration pattern of an Android notification will be customised then add the following

<uses-permission android:name="android.permission.VIBRATE" />

Notification icons should be added as a drawable resource. The example project/code shows how to set default icon for all notifications and how to specify one for each notification. It is possible to use launcher icon/mipmap and this by default is @mipmap/ic_launcher in the Android manifest and can be passed AndroidInitializationSettings constructor. However, the offical Android guidance is that you should use drawable resources. Custom notification sounds should be added as a raw resource and the sample illustrates how to play a notification with a custom sound. Refer to the following links around Android resources and notification icons.

When specifying the large icon bitmap or big picture bitmap (associated with the big picture style), bitmaps can be either a drawable resource or file on the device. This is specified via a single property (e.g. the largeIcon property associated with the AndroidNotificationDetails class) and there will be a corresponding property of the BitmapSource enum type (e.g. largeIconBitmapSource) that indicates if the string value represents the name of the drawable resource or the path to the bitmap file.

Note that with Android 8.0+, sounds and vibrations are associated with notification channels and can only be configured when they are first created. Showing/scheduling a notification will create a channel with the specified id if it doesn't exist already. If another notification specifies the same channel id but tries to specify another sound or vibration pattern then nothing occurs.

When doing a release build of your app, you'll likely need to customise your ProGuard configuration file as per this link and add the following line.

-keep class com.dexterous.** { *; }

The plugin also makes use of GSON and the Proguard rules can be found here. The example app has a consolidate Proguard rules (proguard-rules.pro) file that combines these together for reference.

If you have resource shrinking enabled, ensure that you have customised the resources that should be kept so that things like your notification images aren't discarded by following the instructions here.

IMPORTANT: Starting from version 0.5.0, this library no longer uses the deprecated Android support libraries and has migrated to AndroidX. Developers may require migrating their apps to support this following this guide

iOS Integration #

Add the following lines to the didFinishLaunchingWithOptions method in the AppDelegate.m/AppDelegate.swift file of your iOS project


if (@available(iOS 10.0, *)) {
  [UNUserNotificationCenter currentNotificationCenter].delegate = (id<UNUserNotificationCenterDelegate>) self;


if #available(iOS 10.0, *) {
  UNUserNotificationCenter.current().delegate = self as? UNUserNotificationCenterDelegate

By design, iOS applications do not display notifications when they're in the foreground. For iOS 10+, use the presentation options to control the behaviour for when a notification is triggered while the app is in the foreground. For older versions of iOS, you need to handle the callback as part of specifying the method that should be fired to the onDidReceiveLocalNotification argument when creating an instance IOSInitializationSettings object that is passed to the function for initializing the plugin. A snippet below from the sample app shows how this can be done

// initialise the plugin. app_icon needs to be a added as a drawable resource to the Android head project
var initializationSettingsAndroid =
    new AndroidInitializationSettings('app_icon');
var initializationSettingsIOS = new IOSInitializationSettings(
    onDidReceiveLocalNotification: onDidReceiveLocalNotification);
var initializationSettings = new InitializationSettings(
    initializationSettingsAndroid, initializationSettingsIOS);
    onSelectNotification: onSelectNotification);


  Future onDidReceiveLocalNotification(
      int id, String title, String body, String payload) async {
    // display a dialog with the notification details, tap ok to go to another page
      context: context,
      builder: (BuildContext context) => new CupertinoAlertDialog(
            title: new Text(title),
            content: new Text(body),
            actions: [
                isDefaultAction: true,
                child: new Text('Ok'),
                onPressed: () async {
                  Navigator.of(context, rootNavigator: true).pop();
                  await Navigator.push(
                    new MaterialPageRoute(
                      builder: (context) => new SecondScreen(payload),

If you have set notifications to be periodically shown, then on older iOS versions (< 10), if the application was uninstalled without cancelling all alarms then the next time it's installed you may see the "old" notifications being fired. If this is not the desired behaviour, then you can add code similar to the following to the didFinishLaunchingWithOptions method of your AppDelegate class.


if(![[NSUserDefaults standardUserDefaults]objectForKey:@"Notification"]){
    [[UIApplication sharedApplication] cancelAllLocalNotifications];
    [[NSUserDefaults standardUserDefaults]setBool:YES forKey:@"Notification"];


if(!UserDefaults.standard.bool(forKey: "Notification")) {
    UserDefaults.standard.set(true, forKey: "Notification")

When using custom notification sound, developers should be aware that iOS enforces restrictions on this (e.g. supported file formats). As of this writing, this is documented by Apple at


IMPORTANT: There is an issue that prevents this plugin working properly with the firebase_messaging plugin at this point in time. This is being tracked here. Please upvote if this issue is important to you for the Flutter team to prioritise

Testing #

As the plugin class is not static, it is possible to mock and verify it's behaviour when writing tests as part of your application. Check the source code for a sample test suite can be found at test/flutter_local_notifications_test.dart that demonstrates how this can be done.


  • [Android] Added ability to specify timeout duration of notification
  • [Android] Added ability to specify the notification category


  • Updated plugin to make use of flutter_local_notifications_platform_interface version 1.0.1. This allows for platform-specific implementations of the platform interface to now be accessible.
  • BREAKING CHANGE Plugin callbacks are no longer publicly accessible
  • BREAKING CHANGE [iOS] Local notifications that launched the app should now only be processed by the plugin if they were created by the plugin.


  • BREAKING CHANGE [iOS] Added checks to ensure callbacks are only invoked for notifications originating from the plugin to improve compatibility with other notification plugins.
  • [Android] Bump Gradle plugin to 3.5.3


  • Include notes in getting started section to emphasise that the steps in the integration guide for each platform needs to be done.
  • Move information in the readme on configuring resources to keep on Android.


  • Update link to repository due to restructuring.


  • Update readme with Swift example code on cancelling local notifications using the deprecated UILocalNotification iOS APIs when trying to prevent local notifications from appearing in the scenario where user has uninstalled the app whilst there are pending notification requests, reinstalled the app and ran it again.


  • Add support for media notification. This currently only supports showing the specified image as album artwork. Thanks to PR by gianlucaparadise


  • Fix readme where Objective-C was written twice


  • [Android] Add ability to customise visibility of a notification on the lockscreen. Thanks to PR by gianlucaparadise
  • [Android] Bumped compile and target SDK to 29
  • BREAKING CHANGE [iOS] Plugin no longer registers as a UNUserNotificationCenterDelegate. This is to enable compatibility with other plugins that display notifications. Developers must now do this themselves. Refer to the updated iOS integration section for more info on this
  • Updated info about configuring Proguard configuration rules and included a file that could be used for reference in the example app
  • Removed dependency on the meta package
  • BREAKING CHANGE Now requires Flutter SDK 1.10.0 or greater
  • Migrate the plugin to the pubspec platforms manifest


  • Update example to fix issue 372 around app not firing onSelectNotification having switched to using streams and initialising the app in the main function.


  • Add note to readme that plugin initialisation be done as part of showing the first page of the app.


  • Fix typo in readme. Thanks to PR submitted by Michael Arndt
  • Updated API docs and example around initializing the plugin to make it clearer that initialize should only be called once on app startup.


  • [iOS] Fix issue 336 where a native crash occurred after creating a notification with a null body


  • [Android] Changed intents to use the FLAG_UPDATE_CURRENT flag instead of FLAG_CANCEL_CURRENT as alarms weren't being cleared out properly when updating or cancel a notification. Thanks to WJQ for submitting the PR to address the cancellation issue


  • Remove ScheduledAndroidNotificationPrecision enum that wasn't being used
  • Update readme around approach used to develop the plugin


  • [iOS] Fix issue 295 where onSelectNotification callback wasn't trigger when a notification had been tapped on whilst the app was terminated


  • Update comment in example around grouped notifications to clarify that the summary notification ia required for all versions of Android
  • Update email address in pubspec.yaml


  • [iOS] Accepted PR from Josh Burton that improves ability for plugin to work in multiple isolate by moving state to instance variables
  • [iOS] Add a guard to prevent a scenario from happening where it may still be possible for the onDidReceiveLocalNotification callback to trigger on iOS 10+
  • Minor update to readme on raising issues and correction on payload information


  • Added an optional parameter named androidAllowWhileIdle to schedule method. This will allow notifications to still display at the specified time when the Android device is in an low-power idle mode.
  • BREAKING CHANGE Bump minimum Flutter version to 1.5.0
  • BREAKING CHANGE Update Flutter dependencies


  • Fix build status badge


  • Started adding Cirrus CI configuration and include CI status badge as part of readme


  • Updated readme to include information about OS limits related to scheduled notifications


  • [Android] Added ability to specify the "ticker" text. Thanks to PR submitted by Zhang Jing
  • Spelling mistake fixes in readme. Thanks to PR submitted by Wanbok (Wayne) Choi


  • BREAKING CHANGE [Android] Updated to Gradle 5.1.1 and Android Gradle plugin has been updated to 3.4.0 (aligns with Android Studio 3.4 release). Example app has also been updated to Gradle 5.1.1. Apps will need to update to use the plugin. Please see here for more information if you need help on updating
  • [Android] Add ability to specify the LED colour of the notification. Updated example app to show this can be done. Note that for Android 8.0+ (i.e. API 26+) that this is tied to the notification channel


  • [Android/iOS] Added pendingNotificationRequests method. This will return a list of pending notification requests that have been scheduled to be shown in the future. Updated example app to include sample code for calling the method
  • [Android] Fix an issue where scheduling a notification (recurring or otherwise) with the same id as another notification that was scheduled with the same id would result in both being stored in shared preferences. The shared preferences were used to reschedule notifications on reboot and shouldn't affect the functionality of displaying the notifications
  • Updated plugin methods to return Future<void> instead of Future as per Dart guidelines
  • Updated README to mention known issue with scheduling notifications and daylight savings
  • Refactored widgets in example app


  • BREAKING CHANGE [Android] Updated Gradle plugin to 3.3.2
  • BREAKING CHANGE [Android] Changed to store the name of drawable specified as the small icon to be used for Android notifications instead of the resource ID. This should fix the scenario where an app could be updated and the resource IDs got change and cause scheduled notifications to not appear. Believe this fix should retroactively apply for notifications scheduled with an icon specified but won't apply to those that were scheduled to use the default icon specified via the initialize method. This is due to the fact the name of the default icon wasn't being cached in previous ones but this has now changed so it's cached in shared preferences from this version onwards


  • Fix for when multiple isolates use the plugin. Thanks to PR submitted by xtelinco
  • Added the channelAction field to the AndroidNotificationDetails class. This provides options for managing notification channels on Android. Default behaviour is to create the notification channel if it doesn't exist (which was what it it use to do). Another option is to update the details of the notification channel. Example app has been updated to demonstrate how to update a notification channel when sending a notification


  • Highlight note on migrating to AndroidX more in README


  • README corrections and add information on migrating to AndroidX


  • Updated gradle plugin of example app to 3.3.1
  • Added support for messaging style notifications on Android as requested in issue 159. See example app for some sample code


  • BREAKING CHANGE Migrated to use AndroidX as the Android support libraries are deprecated. There shouldn't be any functional changes. Developers may require migrating their apps to support this following this guide. This addresses issue 162. Thanks to Jeff Scaturro for submitting the PR for this work. Note that if you don't want to migrate your app to use AndroidX yet then you may need to pin dependencies to a specific version


  • Fix issue 160 so that notifications created with the schedule on Android will appear at the exact date and time they are scheduled




  • BREAKING CHANGE Fix naming of onDidReceiveLocalNotification property in the IOSInitializationSettings class (was previously named onDidReceiveLocalNotificationCallback by accident)


  • BREAKING CHANGE removed registerUNNotificationCenterDelegate argument for the IOSInitializationSettings class as it wasn't actually used.
  • Plugin can now handle didReceiveLocalNotification delegate method in iOS and allow developers to handle the associated callback in Flutter. Added a onDidReceiveLocalNotificationCallback argument to the IOSInitializationSettings class to enable this and updated the sample code to demonstrate the usage. This should resolve issue 14.


  • Merged PR from Aine LLC (ganessaa) to fix issue 140 where scheduled notifications were shown immediately on iOS versions before 10. Note that this issue is likely related to an known issue in the Flutter engine that may require switching channels to be addressed as the fix isn't on the stable channel yet.
  • [Android] Provide a way to hide the large icon when showing an expanded big picture notification via the hideExpandedLargeIcon flag within thr BigPictureStyleInformation class. This provides a solution for issue 136. Updated the example to demonstrate
  • Merged PR from (riccardoratta) so that sample code is coloured in GitHub to improve readability.


  • Update changelog to indicate when MessageHandler typedef got renamed (in 0.4.1) as raised in issue 132


  • BREAKING CHANGE Fix issue 127 by changing plugin to Android Support Library version 27.1.1, compile and target SDK version to 27 due to issues Flutter has with API 28.


  • Remove unused code in example app


  • BREAKING CHANGE renamed the selectNotification callback exposed by the initialize function to onSelectNotification
  • BREAKING CHANGE renamed the MessageHandler typedef to SelectNotificationCallback
  • BREAKING CHANGE updated plugin to Android Support Library version 28.0, compile and target SDK version to 28
  • Address issue 115 by adding validation to the notification ID values. This ensure they're within the range of a 32-bit integer as notification IDs on Android need to be within that range. Note that an ArgumentError is thrown when a value is out of range.
  • Updated the Android Integration section around registering receivers via the Android manifest as per the suggestion in 116
  • Updated version of the http dependency for used by the example app


  • [Android] Fix issue 112 where big picture notifications wouldn't show


  • [Android] Added ability to show progress notifications and updated example app to demonstrate how to display them


  • Added getNotificationAppLaunchDetails() method that could be used to determine if the app was launched via notification (raised in issue 99)
  • Added documentation around ProGuard configuration to Android Integration section of the README


  • [Android] Fix issue 88 where cancelled notifications could reappear on reboot.


  • [Android] Add mapping to the setOnlyAlertOnce method 83. Allows the sound, vibrate and ticker to be played if the notification is not already showing
  • [Android] Add mapping to setShowBadge for notification channels that controls if notifications posted to channel can appear as application icon badges in a Launcher


  • [Android] Will now throw a PlatformException with a more friendly error message on the Flutter side when a specified resource hasn't been found e.g. when specifying the icon for the notification
  • Fix overflow rendering issue in the example app


  • [Android] Fix issue 71 where the wrong time on when the notification occurred is being displayed. BREAKING CHANGE this involves changing it the receiver for displaying a scheduled notification will only build the notification prior to displaying it. There is a fix applied to existing scheduled notifications in this release that will be eventually be removed as going forward all scheduled notifications will work as just described
  • [Android] Fix an issue with serialising and deserialising the notifications so that additional style types (big picture and inbox) would be recognised. This affected scheduled notifications where upon rebooting the device, the plugin would need to reschedule the notifications using information saved in shared preferences.


  • [iOS] Fixes issue 61 where the showDailyAtTime and showWeeklyAtDayAndTime methods may not show notifications that should appear the next day. Thanks to Jeff Scaturro for submitting the PR to fix this.


  • No functional changes. Updated the README around raising issues, recurring Android notifications on Android and a fix in the getting started section (thanks to ebeem for spotting that).


  • No functional changes in this release but removed a class that is no longer used due to changes in 0.3.0
  • Updated README information the example app and configuring Android notification icons
  • Changelog is now in reverse chronological order so details about the most recent release are at the top
  • Additional comments in the example's main.dart file to refer to downloading the complete example app project from GitHub


  • BREAKING CHANGES restructured code so that only a single import statement is now needed to use the plugin. Classes that had the platform (Android/iOS) as a suffix are now prefixes to improve readability of code and follow the recommendations for writing Dart code i.e. write code that reads more like a sentence. The following have been renamed

    • InitializationSettingsAndroid -> AndroidInitializationSettings
    • InitializationSettingsIOS -> IOSInitializationSettings
    • NotificationDetailsAndroid -> AndroidNotificationDetails
    • NotificationStyleAndroid -> AndroidNotificationStyle
    • NotificationDetailsIOS -> IOSNotificationDetails
  • [Android] Ability to set the large icon used for each notification. See example app for sample code

  • [Android] Ability to create a notification with the big picture style. See example app for sample code

  • Correct license text


  • Fix error in calling initialize error on iOS versions < 9



  • [Android] Fix issue with showDailyAtTime and showWeeklyAtDayAndTime where time occurred in the past and caused notification to trigger instantly


  • [Android] Fix bug with applying ongoing and autoCancel properties


  • [Android] Bug fix for previous release


  • [Android] Add ability to set the colour.


  • [Android/iOS] Add ability to have a notification shown daily at a specified time. Credits to Javier Lecuona for submitting the PR for this.
  • [Android/iOS] Add ability to have a notification shown weekly on a specific day and time.


  • [Android/iOS] Fix RepeatInterval not being mapped to the correct values on the native side. Thanks to Thibault Deckers for spotting the issue.


  • [Android/iOS] Add ability to set a notification to be periodically displayed
  • [Android] Fix a bug where the small icon could not be be found when loading scheduled notifications from shared preferences to reschedule them on a device reboot
  • [Android] Fix example app manifest file


  • [Android] Add ability to specify if notifications should automatically be dismissed upon touching them
  • [Android] Add ability to specify in notifications are ongoing
  • [Android] Fix bug in cancelling all notifications


  • [Android/iOS] Add ability to cancel/remove all notifications


  • [Android] Bug fix for grouping notifications


  • [Android] Add ability to show grouped notifications. Example code has been updated to demonstrate this functionality.
  • Fixed the example project so it works with the new release of Cocoapods (1.5.0)
  • Fixes for when API methods were called without specifying platform specific settings


  • BREAKING CHANGES Apologies again, this is another cleanup release. FlutterLocalNotifications class has been renamed to FlutterLocalNotificationsPlugin now as it makes more sense from a readability perspective. More importantly, the class and methods are also no longer static to faciliate mocking and testing. It's something I should've picked up on earlier so sorry once again. Check the source code for an example on how to mock the plugin when testing


  • BREAKING CHANGES There are no functional changes. This is an API cleanup release where I've reorganised the Dart classes to better separate them by platform. What this means is that the import statements in your coode will need to be fixed. Apologies to anyone using the plugin but I feel that this was necessary as Flutter may target additional platforms in the future. Hopefully you'll agree that the end result looks a better :)


  • [Android] Add inbox notification style


  • Fix broken example app for iOS due to incorrect reference to custom sound file. Added ability to handle when a notification is tapped. See updated example for details on how to do this and will navigate to another page. Note that the second page isn't rendering full-screen on Android if the notification was tapped on while the app was in the foreground. Suspect that this is Flutter rendering issue and have logged this on the Flutter repository at https://github.com/flutter/flutter/issues/16636


  • [Android] Bug fix in calculating when to show a scheduled notification. Ensure scheduled Android notifications will remain scheduled even after rebooting.


  • [Android] Add ability to use HTML markup to format the title and content of notifications


  • [Android] Add support for big text style for and being able format the big text style specific content using HTML markup.


  • [iOS] Enable ability to customise the sound for notifications (IMPORTANT requires testing on older iOS versions < 10)
  • [iOS] Can now specify default presentation options (BREAKING CHANGE named parameters for iOS initialisation have changed) that can also be overridden at the notification level).
  • [iOS] Fixes for reading in specified options


  • [Android] Enable ability to customise sound and vibration for notifications.


  • [Android] Fix notifications so that tapping on them will remove them and will also start the app if it has been terminated.


  • [iOS] Add ability to customise the presentation options when a notification is triggered while the app is in the foreground for notifications presented using the User Notifications Framework (iOS 10+). IMPORTANT: the named parameters for iOS initialisation settings constructor have had to change to differentiate between permission options and presentation options


  • [iOS] Updates to code to support both legacy notifications via UILocalNotification (before iOS 10) and the User Notifications framework introduced in iOS 10


  • Updated README


  • Fix changelog


  • README fixes


  • Initial release


flutter_local_notifications_example #

Demonstrates how to use the flutter_local_notifications plugin.

Getting Started #

For help getting started with Flutter, view our online documentation.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  flutter_local_notifications: ^1.1.1

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:flutter_local_notifications/flutter_local_notifications.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Jan 21, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.0
  • pana: 0.13.4
  • Flutter: 1.12.13+hotfix.5

Health suggestions

Format lib/src/platform_specifics/android/enums.dart.

Run flutter format to format lib/src/platform_specifics/android/enums.dart.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.28.0 <3.0.0
flutter 0.0.0
flutter_local_notifications_platform_interface ^1.0.1 1.0.1
platform ^2.2.1 2.2.1
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
mockito ^4.1.1
plugin_platform_interface ^1.0.1 1.0.1