A Flutter plugin for displaying local notifications on Android, iOS and macOS

Overview

Flutter Local Notifications plugin

This repository consists hosts the following packages

These can be found in the corresponding directories within the same name. Most developers are likely here as they are looking to use the flutter_local_notifications plugin. There is a readme file within each directory with more information.

Issues

If you run into bugs, 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

The guidelines around submitting pull requests can be found here

Comments
  • Support for custom notification actions

    Support for custom notification actions

    The plugin should provide the ability to specify custom notification actions. However, this will depends on the Flutter engine being able to support headless-Dart code as per https://github.com/flutter/flutter/issues/6192 and https://github.com/flutter/flutter/issues/3671

    It appears Android support is there but will wait to see on if the engine can support it for iOS applications, and for Flutter to provide abstractions to access the functionality. Without the support being added in, then this won't work for scenarios like when the application has been terminated as the logic associated with the action would've been defined in Dart.

    Update with remaining work (IMO)

    • [x] rework callbacks to deal with "foreground" and "background" notification actions. See https://github.com/MaikuB/flutter_local_notifications/pull/1489 for more detailed discussion
    • [x] potential issue with setting notification categories affecting ability to see the notification actions https://github.com/MaikuB/flutter_local_notifications/issues/1481

    Note that last two perhaps could be omitted given market share and those require using deprecated APIs

    Edit:

    • there is headless execution on iOS but there are limitations at the moment. See https://github.com/flutter/flutter/issues/23904. Upvote the issue on the Flutter repo if this concerns you to help the Flutter team prioritise
    • removed tasks on supporting older iOS and macOS versions given market share and those require using deprecated APIs
    enhancement help wanted 
    opened by MaikuB 163
  • WIP: [flutter_local_notifications ] Notification actions for iOS, macOS, Android

    WIP: [flutter_local_notifications ] Notification actions for iOS, macOS, Android

    This PR addresses #17 - and includes a very basic implementation for iOS & Android.

    A click on the notification will launch (if not already running) a separate Flutter engine, which initializes a callback dispatcher. The dispatcher function then sets up platform communication for other plugins and starts listening to a event channel for existing or additional notification click events.

    Screenshots

    Android:

    Simple actions:

    screen

    Text input actions to collect user entered text:

    screen

    iOS:

    Simulator Screen Shot - iPod touch (7th generation) - 2020-11-01 at 09 23 40

    macOS:

    Simple actions:

    Screen Shot 2021-12-29 at 20 50 59

    Text input actions to collect user entered text:

    Screen Shot 2022-01-02 at 22 28 54

    The PR is in early stage to gather feedback on the basic use case by others.

    Feedback requested

    Please support this PR by testing it in your own App and comment with missing features / use cases.

    To use it, add the following to your pubspec.yaml file:

    dependency_overrides:
      flutter_local_notifications:
        git:
          url: https://github.com/ened/flutter_local_notifications.git
          path: flutter_local_notifications
          ref: 17-notification-actions
      flutter_local_notifications_platform_interface:
        git:
          url: https://github.com/ened/flutter_local_notifications.git
          path: flutter_local_notifications_platform_interface
          ref: 17-notification-actions
    

    The documentation is still very incomplete, therefore please refer to the example project of this branch.

    Open tasks

    • [x] Text input & predefined action (Android) support
    • [x] Android: Notification Actions text color: https://stackoverflow.com/questions/41073294/how-to-change-notification-action-text-color-in-android-n
    • [ ] Documentation
    • [ ] Test coverage
    • [x] macOS support
    • [x] metadata/payload accessible in action handler
    • [x] autoCancel property for android notification action handler that dismisses the notification (feature parity with iOS)
    notification actions 
    opened by ened 98
  • 'showDailyAtTime()' dose not  work as expected

    'showDailyAtTime()' dose not work as expected

    Describe the bug The follwoing phenomena occur on android phones and I am not sure whether they would occur on iOS phones or not.

    1. 'showDailyAtTime()' dose not work as expected, which should have pushed the notification at a specific time but failed;
    2. Two apps invoking this plugin and running on a same Android phone seems tending to push notifications at the same time using 'showDailyAtTime()';
    3. Very often, when pushing notifications, more than 1 notifications are pushed at the same time with 'showDailyAtTime()';

    These issues have nothing to do with the phone model, as I have tried on different phones. In addition, I do not know why the built-in example code of "flutter_local_notifications" cannot work, as every time I lauched the App, it crashes and prompted "flutter_local_notifications_example 已停止。"

    To Reproduce

    This plugin used to work normally, but after I did some things like: upgrading the flutter SDK and tweaking the codes in gradle file to suite the new SDK and updated plugins, these bugs appeared. I tried to rewind everything to somewhere the code can work normally, which includes getting back the old flutter SDK version and the gitted code, but all failed.

    What do I need If possible, please simply give me some clues why these phenomena happens. Thanks so much for your help.

    opened by TristanWYL 46
  •  Unhandled Exception: MissingPluginException(No implementation found for method initialize on channel dexterous.com/flutter/local_notifications)

    Unhandled Exception: MissingPluginException(No implementation found for method initialize on channel dexterous.com/flutter/local_notifications)

    I'm trying to fire a notification when the background location callback returns. But this leads into the following exception: Unhandled Exception: MissingPluginException(No implementation found for method initialize on channel dexterous.com/flutter/local_notifications)

    I know, that there was an issue with the same problem before, but there was no solution provided.

    opened by p493z3r0 43
  • Possible security exploited finded

    Possible security exploited finded

    While i was fininshing my fork to implement a basic Action Button functionality, i finded a high possible security issue for every app using the flutter_local_notification.

    Causes:

    The payload returned between the native code and Flutter method callback is plain text. That means the app above should extract that plain text value to process it. Taking note that some of key informations, such notification id, are lost in MethodCall transition process, the actual scenario estimulate the app developer to put complex references over plain text payload do caputure it after the user taps on notification.

    If that app allows another users with low priviledge to send notifications to someone, now they have access to send malicious strings through notifications that could reach internal process steps and allow code or parameters injection to manipulate the app.

    Example

    Consider a App using a json encoded string over payload to recovery its references after the user tap a notification. A malicious user could inject another json encoded string (with manipulated parameters or extra fields) through the body message or even on a input text response, such as Android´s RemoteInput. After the tap event, the malicious code could be processed and interpreted, allowing the user to reach unauthorized pages or functionalities. such as expired promotion codes, privated messages, etc.

    Solution

    The solution is to return over MethodCall flutter listener an object and not a plain text. As the layers between android and ios cannot communicate with dart files passing memory object ( because they are made from different technologies ) we gonna pass the object encoded, containing the payload string escaped, and decode the object to memory on flutters ´s side, without need to check the payload, considering that every user input contains unsafe information.

    Under the object used to transfer the information, we gonna put the others notification information, such notification_id, etc.

    The difference bettween the plugin doing that oposes the app is the pluggin extends to native code, where is completely possible to distinguish parameters from payload without need to process and interpret the payload content.

    But the obvious consequence is the new returned payload is totaly different from the old one. The new method is naturaly incompatible with App who readed plain text from the olders versions.

    So i propose to create a copy of onSelectNotification, on called onReceiveNotification, passing a object to the receiver event, and also to mark the old onSelectNotification as deprecated and unsecure. That way the new notification plugin will not becom totaly incompatible with those apps, the developers will be warned about the danger and will keep receiving another updates until they change their codes.

    So, what you guys think about that? there is a better way to do those changes?

    opened by rafaelsetragni 31
  • onSelectNotification code not being called when a notification is tapped and the application is not running

    onSelectNotification code not being called when a notification is tapped and the application is not running

    It works perfectly while the app is running, but when the application is closed the function is not called.

    The code can be found here https://github.com/GroovinChip/CallManager/blob/dev/lib/HomeScreen.dart

    I can't provide a stacktrace because the issue only occurs while the app is not running.

    If you'd be so kind as to provide quick assistance, I'd really appreciate it - I had to pull a crucial feature from production due to this bug.

    Thanks!

    opened by GroovinChip 29
  • [flutter_local_notifications] Linux support

    [flutter_local_notifications] Linux support

    The Desktop Notifications Specification is used as an implementation.

    I have separated the Linux plugin package from the main plugin package. This is necessary to correctly implement the Dart version of the plugin without using native code. For example, dbus package is used to communicate with the Desktop Notifications Specification and a few more auxiliary packages that allow to access native methods/environment. Once this pull request is merged in the new version of the plugin, change the relative path to the package in pubspec.yaml: https://github.com/proninyaroslav/flutter_local_notifications/blob/ddc57043dcb6d68bd94d48b9fc601753ff4f899c/flutter_local_notifications/pubspec.yaml#L15

    Implemented features:

    • initialize() method and LinuxInitializationSettings.
    • show() method and LinuxNotificationDetails.
    • cancel(), cancelAll() methods.
    • getCapabilities() method, which returns some of the capabilities implemented by the system notification service. Please see Desktop Notifications Specification#Backwards Compatibility.
    • getSystemIdMap() method, that returns a Map with the specified notification id as the key and the id, assigned by the system, as the value. Because by specification, the system itself generates notification id, an [app id: system id] map is used, which is cached within the user session.

    Non-implemented features:

    • Notification actions. It's possible to implement them, but I didn't do this, because there is still no established/official API in the plugin. For example, one of the possible implementations that is not yet upstream https://github.com/MaikuB/flutter_local_notifications/pull/880.
    • Scheduled/pending notifications. As mentioned here https://github.com/MaikuB/flutter_local_notifications/pull/1208#issuecomment-869552295, currently, the scheduler implementation is fraught with difficulties, because Linux doesn't have an appropriate API. As a possible option, we can consider interacting with systemd (similar to launchd on macOS) via D-Bus API of systemd (as done in the Desktop Notifications Specification). This will allow the scheduler to run as a system service. I haven't yet investigated how realistic it's to implement it in the plugin without changes from the application developer/user side.
    • getNotificationAppLaunchDetails(). To respond to notification after the application is terminated, the application should be registered as DBus activatable (see DBusApplicationLaunching for more information), and register action before activating the application. This is difficult to do in a plugin because plugins instantiate during application activation, so getNotificationAppLaunchDetails can't be implemented without changing the main user application.

    Testing the Desktop Notifications Specification in real-world conditions is difficult, because different Linux distributions and DE may or may not implement some of the specification things. For example, on GNOME, you can't set a timeout, custom sound, or screen location. Therefore, I wrote extensive tests that validate the request setmantics and format required by the Desktop Notifications Specification. For real world testing of notifications, I would recommend using different DEs such as GNOME (e.g Ubuntu or Fedora), KDE (e.g Kubuntu), XFCE (e.g Xubuntu), MATE (e.g Ubuntu MATE), etc.

    I also ask you to pay attention to these two methods: https://github.com/proninyaroslav/flutter_local_notifications/blob/ddc57043dcb6d68bd94d48b9fc601753ff4f899c/flutter_local_notifications_linux/lib/src/typedefs.dart#L5 https://github.com/proninyaroslav/flutter_local_notifications/blob/ddc57043dcb6d68bd94d48b9fc601753ff4f899c/flutter_local_notifications_linux/lib/src/helpers.dart#L9 Because I split the Linux plugin version into a separate package, I had to copy these two methods for the plugin to work correctly. It might be worth leaving that as it is. Although you might consider moving the common methods into a separate package.

    gnome_linux_notification kde_linux_notification 2021-07-11 11-11-08

    opened by proninyaroslav 26
  • zonedSchedule not working on my phone

    zonedSchedule not working on my phone

    Hi,

    I used to zonedSchedule to send notifications at the specific time, it works fine on the emulator but when I try different real devices and schedule notification at the specific time, there is no notification, crash, or error.

    Here is my code:

    tz.initializeTimeZones();
    
          var now = DateTime.now();
    
          var time2 = tz.TZDateTime(
            tz.local,
            now.year,
            now.month,
            now.day,
            _selectedTime.hour,
            _selectedTime.minute,
          );
    
          int notificationID = widget.newActivity.id;
    
          _flutterLocalNotificationsPlugin
              .zonedSchedule(
                  notificationID, title, body, time2, generalNotificationDetails,
                  uiLocalNotificationDateInterpretation:
                      UILocalNotificationDateInterpretation.absoluteTime,
                  androidAllowWhileIdle: true)
              .then((value) {
            _setAlarm(widget.newActivity.id, _formattedTime);
            setState(() {
              _hasNotification = true;
            });
            print("notification created!");
          });
    
    opened by draxex 23
  • On restart, all previous notifications reschedule themselves despite being dismissed before.

    On restart, all previous notifications reschedule themselves despite being dismissed before.

    Hi MaikuB, I seem to be encountering an issue where when notifications are displayed and manually dismissed, upon restarting the device, when the phone boots up, all previous notifications that occurred while the phone was turned on suddenly all come in all at once. It's as if they were never really dismissed.

    If I set a notification to fire at a specific time, it, fires, then I manually call "CancelNotification" on that single notification with that ID, even though this successfully removes the notification and dismisses it from the status bar, when I restart the phone, it reappears as if it were never canceled.

    If I use "CancelAllNotifications" however, it does truly "cancel" it and previously dismissed notifications don't reappear upon restart, but obviously, I can continuously call "CancelAllNotifications" for a single notification because it will remove all the other unrelated notifications iv'e set up as well.

    Any idea about this?

    opened by SuitMonkeyB 23
  • Use try/catch

    Use try/catch

    Describe the bug I have an app with 3 million downloads and flutter_local_notifications are the #1 issues on Crashlytics (not because of this plugin, but because Android itself sucks).

    What I do is to fill the plugin Java code with try/catches to ignore errors so the app won't crash (the users will not receive notifications, but at least they can use the app).

    Here are some logs (those are just examples: almost every point in this plugin crashes, including boot_received): image

    Fatal Exception: java.lang.RuntimeException: Unable to start receiver com.dexterous.flutterlocalnotifications.ScheduledNotificationReceiver: java.lang.NullPointerException: Attempt to write to field 'long android.app.Notification.when' on a null object reference
           at android.app.ActivityThread.handleReceiver(ActivityThread.java:3369)
           at android.app.ActivityThread.-wrap20(ActivityThread.java)
           at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1726)
           at android.os.Handler.dispatchMessage(Handler.java:102)
           at android.os.Looper.loop(Looper.java:154)
           at android.app.ActivityThread.main(ActivityThread.java:6776)
           at java.lang.reflect.Method.invoke(Method.java)
           at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1518)
           at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1408)
    
    Caused by java.lang.NullPointerException: Attempt to write to field 'long android.app.Notification.when' on a null object reference
           at com.dexterous.flutterlocalnotifications.ScheduledNotificationReceiver.onReceive(ScheduledNotificationReceiver.java:32)
           at android.app.ActivityThread.handleReceiver(ActivityThread.java:3362)
           at android.app.ActivityThread.-wrap20(ActivityThread.java)
           at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1726)
           at android.os.Handler.dispatchMessage(Handler.java:102)
           at android.os.Looper.loop(Looper.java:154)
           at android.app.ActivityThread.main(ActivityThread.java:6776)
           at java.lang.reflect.Method.invoke(Method.java)
           at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1518)
           at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1408)
    

    image

    Fatal Exception: java.lang.RuntimeException: Unable to start receiver com.dexterous.flutterlocalnotifications.ScheduledNotificationReceiver: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.Integer.intValue()' on a null object reference
           at android.app.ActivityThread.handleReceiver(ActivityThread.java:3658)
           at android.app.ActivityThread.access$1400(ActivityThread.java:245)
           at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1839)
           at android.os.Handler.dispatchMessage(Handler.java:106)
           at android.os.Looper.loop(Looper.java:216)
           at android.app.ActivityThread.main(ActivityThread.java:7258)
           at java.lang.reflect.Method.invoke(Method.java)
           at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
           at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:975)
    
    Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.Integer.intValue()' on a null object reference
           at com.dexterous.flutterlocalnotifications.FlutterLocalNotificationsPlugin.setupNotificationChannel(FlutterLocalNotificationsPlugin.java:634)
           at com.dexterous.flutterlocalnotifications.FlutterLocalNotificationsPlugin.createNotification(FlutterLocalNotificationsPlugin.java:130)
           at com.dexterous.flutterlocalnotifications.FlutterLocalNotificationsPlugin.showNotification(FlutterLocalNotificationsPlugin.java:688)
           at com.dexterous.flutterlocalnotifications.ScheduledNotificationReceiver.onReceive(ScheduledNotificationReceiver.java:45)
           at android.app.ActivityThread.handleReceiver(ActivityThread.java:3649)
           at android.app.ActivityThread.access$1400(ActivityThread.java:245)
           at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1839)
           at android.os.Handler.dispatchMessage(Handler.java:106)
           at android.os.Looper.loop(Looper.java:216)
           at android.app.ActivityThread.main(ActivityThread.java:7258)
           at java.lang.reflect.Method.invoke(Method.java)
           at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
           at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:975)
    

    image

    Fatal Exception: java.lang.RuntimeException: Unable to start receiver com.dexterous.flutterlocalnotifications.ScheduledNotificationReceiver: java.lang.NullPointerException: Attempt to read from field 'java.lang.String com.dexterous.flutterlocalnotifications.models.NotificationDetails.channelId' on a null object reference
           at android.app.ActivityThread.handleReceiver(ActivityThread.java:4012)
           at android.app.ActivityThread.access$1500(ActivityThread.java:232)
           at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2025)
           at android.os.Handler.dispatchMessage(Handler.java:107)
           at android.os.Looper.loop(Looper.java:241)
           at android.app.ActivityThread.main(ActivityThread.java:7617)
           at java.lang.reflect.Method.invoke(Method.java)
           at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
           at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:941)
    
    Caused by java.lang.NullPointerException: Attempt to read from field 'java.lang.String com.dexterous.flutterlocalnotifications.models.NotificationDetails.channelId' on a null object reference
           at com.dexterous.flutterlocalnotifications.models.NotificationChannelDetails.fromNotificationDetails(NotificationChannelDetails.java:74)
           at com.dexterous.flutterlocalnotifications.FlutterLocalNotificationsPlugin.createNotification(FlutterLocalNotificationsPlugin.java:138)
           at com.dexterous.flutterlocalnotifications.FlutterLocalNotificationsPlugin.showNotification(FlutterLocalNotificationsPlugin.java:803)
           at com.dexterous.flutterlocalnotifications.ScheduledNotificationReceiver.onReceive(ScheduledNotificationReceiver.java:56)
           at android.app.ActivityThread.handleReceiver(ActivityThread.java:4003)
           at android.app.ActivityThread.access$1500(ActivityThread.java:232)
           at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2025)
           at android.os.Handler.dispatchMessage(Handler.java:107)
           at android.os.Looper.loop(Looper.java:241)
           at android.app.ActivityThread.main(ActivityThread.java:7617)
           at java.lang.reflect.Method.invoke(Method.java)
           at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
           at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:941)
    
    opened by JCKodel 22
  • [Feature request] Improve API for setting intervals

    [Feature request] Improve API for setting intervals

    I previously used showDailyAtTime to set a daily reminder - that was a pretty nice API.

    I saw it was deprecated, and now to add intervals was pretty rough..

    • First you have to get a time zone, by initializing a database and calling either a platform call or getting a third party package.
    • Then you have to be sure the TZDateTime, given the timezone location, has a date in the future ( or it will crash ), even though i'm only interested in the hour and seconds of the day.
    • Then you have to pick the DateTimeComponents which only have two items.

    This was a lot of work to get up and running. I think this could be improved upon.

    opened by erf 21
  • For Loop does not work when app is closed

    For Loop does not work when app is closed

    Hi, actually I am using work manager and sending notifications when the app is closed. The progress one which was shown in the example works fine when the app is in the foreground or background(Means in Recent) and I got working it when the app is closed using WorkManager but for loop does not get executed. Without it Notification works properly even when app is closed. here is the example code from Workmanager().executeTask(...); all the dependencies has been initiated after that...

        for (decDuration = 0; decDuration >= durationElapsed.inSeconds; decDuration++) {
          await Future.delayed(const Duration(seconds: 1)); //here awaiting for 1 sec but no luck
          AppConstants.logger('Testing.....$decDuration');
          AndroidNotificationDetails and = AndroidNotificationDetails(
            'parked_vehicle',
            'Vehicle Parking Time Remaining',
            channelDescription:
                'This Notification will notify the user that vehicle\'s time of booking for the parking is about to expire.',
            importance: Importance.max,
            priority: Priority.max,
            channelShowBadge: false,
            ticker: 'parked_vehicle',
            color: Colors.blue,
            onlyAlertOnce: true,
            showProgress: true,
            progress: decDuration,
            maxProgress: totalDuration.inSeconds,
            visibility: NotificationVisibility.public,
          );
          NotificationDetails platformSpecificDetails =
              NotificationDetails(android: and);
    
          await flutterLocalNotificationsPlugin.show(
            nID,
            '${booking.vehicleNumber} is parked at ${booking.lotName}',
            'Parking is about to end in -- ${AppConstants.formatDuration(Duration(seconds: decDuration))}',
            platformSpecificDetails,
          );
        }
    

    Please let me know if we need to do something more for executing for loop because without for loop await Future.delayed works. I have checked to delay for 3 sec, 3 times.

    opened by aadi-github 0
  • chronometerCountDown going upward only

    chronometerCountDown going upward only

    Hi, I am actually showing a notification that indicates the remaining time of the Booking of the Vehicle parked at the parking lot. eg. From Booking_Time = 2022-10-10 12:25 To Booking_Time = 2022-10-10 18:25

    so the problem is, suppose the time remaining is 06:25:00. In the notification it starts properly but no matter what the value for chronometerCountDown = true/false the timer goes upward only. if chronometerCountDown = false it shows 06:25:00, 06:25:01, 06:25:02, 06:25:03...this is as expected if chronometerCountDown = true it shows -06:25:00, -06:25:01, -06:25:02, -06:25:03...going upward only

    Below is my AndroidNOtificationDetails :: DateTime whenTimer = currentTime.subtract(durationElapsed); AndroidNotificationDetails and = AndroidNotificationDetails( 'parked_vehicle', 'Vehicle Parking Time Remaining', channelDescription: 'This Notification will notify the user that vehicle's time of booking for the parking is about to expire.', importance: Importance.max, priority: Priority.max, channelShowBadge: false, ticker: 'parked_vehicle', color: Colors.blue, onlyAlertOnce: true, when: whenTimer.millisecondsSinceEpoch, timeoutAfter: whenTimer.difference(DateTime.now()).inMilliseconds, usesChronometer: true, chronometerCountDown: true, visibility: NotificationVisibility.public, ongoing: true, );

    I hope I have mentioned my problem properly.

    NOTE: I have checked the example and it shows same behaviour when: DateTime.now().millisecondsSinceEpoch - 120 * 1000, usesChronometer: true, chronometerCountDown: true,

    In short chronometerCountDown: true only adds the "-" sign nothing else.

    opened by aadi-github 0
  • Cancel periodic notification through groupKey

    Cancel periodic notification through groupKey

    How can I cancel a notification through groupKey? I have created multiple notifications with the same id and different groupKey. Now I want to cancel a notification that is specific to a particular groupKey.

    opened by albus25 0
  • Not possible to set presentSound to false / sending a notification without sound

    Not possible to set presentSound to false / sending a notification without sound

    I try to let my user send a silent notification if he wants to: For that I set presentSound to false:

      static Future _notificationDetails() async {
        //print("sound: " + sound.toString());
        return NotificationDetails(
          android: AndroidNotificationDetails(
            'channel id',
            'channel name',
            //'channel description',
            channelDescription: 'channel description',
            importance: Importance.max,
            playSound: false,
            sound: const RawResourceAndroidNotificationSound('sound'),
          ),
          iOS: const DarwinNotificationDetails(
            presentSound: false,
            sound: 'sound.aiff',
          ),
        );
      }
    

    This works in foreground but not if the app is terminated. I always get the notification with sound. I tried with flutter_local_notifications 9.3.2 and 13.0.0. How can I create silent notifications?

    opened by desmeit 0
  •  [flutter_local_notifications] Reference newer flutter_timezone package in readme

    [flutter_local_notifications] Reference newer flutter_timezone package in readme

    As this repository hosts two packages, please ensure the PR title starts with the name of the package that it relates to using square brackets (e.g. [flutter_local_notifications]). The contribution guidelines can be found at https://github.com/MaikuB/flutter_local_notifications/blob/master/CONTRIBUTING.md. Please review this as it contains details on what to follow when submitting a PR.

    With such a simple change, hopefully I did things correctly.

    https://github.com/MaikuB/flutter_local_notifications/issues/1855

    opened by EnduringBeta 0
  • [flutter_local_notifications] suppress deprecation warnings on MACOS relating to old notification APIs #1740

    [flutter_local_notifications] suppress deprecation warnings on MACOS relating to old notification APIs #1740

    Forgive me if this is the incorrect way to suggest this - I'm incredibly grateful for the work you did https://github.com/MaikuB/flutter_local_notifications/pull/1740 and was hoping the same could be done to suppress warning when building for MACOS as well as we use both in production. Thanks for your time.

    opened by ehagerty 0
Releases(flutter_local_notifications-v13.0.0)
  • flutter_local_notifications-v13.0.0(Dec 19, 2022)

    • [Android] Bumped Android Gradle plugin to 7.3.1. Thanks to the PR from Rexios
      • Updated minimum Flutter version to 3.0.0. Note that technically this was already a requirement by flutter_local_notifications_linux 2.0.0 as ffi 2.0.0 requires Dart 2.17 at a minimum and that shipped with Flutter 3.0.0
    • Added explicit ffi dependency that Linux implementation of the plugin was already using
    • Updated site used by example app to display dummy/placeholder images
    • Updated readme to warn developers that choose not to follow the official Android guidance around notification icons that using the @mipmap/ic_launcher resource requires additional release build configuration. Thanks to the PR from Daniel Arndt
    • Updated readme to add note about how Flutter has an issue with apps running with desugaring on Android 12L and above. Thanks to the PR from Mirek Mazel See https://github.com/flutter/flutter/issues/110658. One potential fix added to the readme is for apps to add the WindowManager library as a dependency:
    dependencies {
        implementation 'androidx.window:window:1.0.0'
        implementation 'androidx.window:window-java:1.0.0'
        ...
    }
    
    Source code(tar.gz)
    Source code(zip)
  • flutter_local_notifications-v12.0.4(Nov 21, 2022)

    • Fixed issue 1796 where a java.lang.ClassCastException may be thrown on some Android devices when the onDidReceiveBackgroundNotificationResponse has been specified when calling initialize()
    Source code(tar.gz)
    Source code(zip)
  • flutter_local_notifications-v12.0.3+1(Nov 16, 2022)

    • Updated Kotlin version used in example app
    • Updated code snippets in readme to add missing import statements around the iOS setup related to notification actions. Thanks to PR from som-R91
    Source code(tar.gz)
    Source code(zip)
  • flutter_local_notifications-v12.0.3(Oct 26, 2022)

  • flutter_local_notifications-v12.0.2(Oct 11, 2022)

    • [Android] changed callback lookup for notification actions to take place after Flutter engine to ensure callback cache has been initialised to find the callback. This is a follow-up to changes done in 12.0.1 in trying to address issue 1721
    • [Android] updated plugin to clean up resources after it is detached from Flutter engine. Thanks to PR from Simon Ser
    Source code(tar.gz)
    Source code(zip)
  • flutter_local_notifications-v12.0.1+1(Oct 8, 2022)

  • flutter_local_notifications-v12.0.1(Oct 8, 2022)

    • [Android][iOS] fixed issue 1721 where a crash occurs upon tapping on a notification action fbut the onDidReceiveBackgroundNotificationResponse optional callback hasn't been specified.
    • [iOS] suppressed deprecation warnings where plugin was Apple's old notification APIs to support older iOS devices
    Source code(tar.gz)
    Source code(zip)
  • flutter_local_notifications-v12.0.0(Oct 4, 2022)

  • flutter_local_notifications-v11.0.1(Sep 23, 2022)

    • [Android] fixed crash when using notification actions with a foreground service. Thanks to the PR from Arnold Laishram
    • [Android] Suppressed deprecation warning on calling the getParcelableExtra Intent API
    • Fixed typo in readme around Darwin (iOS/macOS) initialisation settings
    • Added a link to an issue with using Flutter apps with desugaring enabled where crashes could occur on foldable Android devices. Link to this is https://github.com/flutter/flutter/issues/110658 so those experience the problem can follow the issue and try out the solutions there as this isn't specific to the plugin
    • Replaced usage of rxDart in example app use StreamController instead to minimise use of dependencies and removed unused shared_preferences dependency
    Source code(tar.gz)
    Source code(zip)
  • flutter_local_notifications-v11.0.0(Sep 17, 2022)

    • Bumped timezone dependency. To err on the safe when it comes to dependency version conflicts, this is being published as major release as the updated timezone package was published as a major release. Thanks to the PR from Joachim Nohl
    Source code(tar.gz)
    Source code(zip)
  • flutter_local_notifications-v10.0.0(Sep 17, 2022)

    • Breaking change [Android] zonedSchedule()'s implementation has switched to using desugaring instead of the ThreeTen Android Backport library. This required the plugin to update to using Android Gradle plugin 4.2.2 and applications may need to bump their Android Gradle plugin dependency to at least 4.2.2 as a result. Added a "Gradle setup" section underneath "Android setup" with details on the extra setup needed
    • [Android] Breaking change the following error codes included in PlatformExceptions that can occur on Android have been updated
      • INVALID_ICON -> invalid_icon
      • INVALID_LARGE_ICON -> invalid_large_icon
      • INVALID_BIG_PICTURE -> invalid_big_picture
      • INVALID_SOUND -> invalid_sound
      • INVALID_LED_DETAILS -> invalid_led_details
      • GET_ACTIVE_NOTIFICATIONS_ERROR_CODE -> unsupported_os_version
      • GET_NOTIFICATION_CHANNELS_ERROR_CODE -> getNotificationChannelsError
      • GET_ACTIVE_NOTIFICATION_MESSAGING_STYLE_ERROR_CODE -> getActiveNotificationMessagingStyle
      • PERMISSION_REQUEST_IN_PROGRESS -> permissionRequestInProgress
    • [Android] Breaking change the category of the AndroidNotificationDetails now requires an instance of the newly added AndroidNotificationCategory class instead of a string. This was to improve the discoverability of the APIs and improve the semantics as the category can specified in a similar fashion to using an enum value
    • Breaking change callbacks have now been reworked. There are now the following callbacks and both will pass an instance of the NotificationResponse class
      • onDidReceiveNotificationResponse: invoked only when the app is running. This works for when a user has selected a notification or notification action. This replaces the onSelectNotification callback that existed before. For notification actions, the action needs to be configured to indicate the the app or user interface should be shown on invoking the action for this callback to be invoked i.e. by specifying the DarwinNotificationActionOption.foreground option on iOS and the showsUserInterface property on Android. On macOS and Linux, as there's no support for background isolates it will always invoke this callback
      • onDidReceiveBackgroundNotificationResponse: invoked on a background isolate for when a user has selected a notification action. This replaces the onSelectNotificationAction callback
    • Breaking change the NotificationAppLaunchDetails has been updated to contain an instance NotificationResponse class with the payload belonging to the NotificationResponse class. This is to allow knowing more details about what caused the app to launch e.g. if a notification action was used to do so
    • [iOS][macOS] Breaking changes iOS and macOS classes have been renamed and refactored as they are based on the same operating system and share the same notification APIs. Rather than having a prefix of either IOS or MacOS, these are now replaced by classes with a Darwin prefix. For example, IOSInitializationSettings can be replaced with DarwinInitializationSettings
    • [macOS] Breaking change the requestPermissions() method of the MacOSFlutterLocalNotificationsPlugin class now only accepts non-nullable parameters that default to false. This makes it consistent with the iOS implementation of the plugin
    • Added support for notification actions. Massive thanks to Sebastian Roth, Pieter van Loon and Yaroslav Pronin for their work on this. Note that on Apple's platforms, notification actions are only supported on iOS 10 or newer and macOS 10.14 or newer
    • [Linux] Breaking change the linux notification categories defined by LinuxNotificationCategory no longer has factory constructors but has static constant fields instead to make the semantics more similar to access enum values
    • [Android] Updated how scheduled notifications are saved to shared preferences so it is done in the background. This is to fix issue 1378 where pendingNotificationRequests method may not report the correct number of scheduled notifications if it is invoked before the data had been saved to shared preferences
    • [Android] fixed issue 1702 by handling deprecation warnings using specific Android Intent APIs on Android 13 (API level 33) or newer
    • [iOS] getActiveNotifications() is now supported for iOS versions 10.0 or newer
    • [macOS] getActiveNotifications() is now supported for macOS versions 10.14 or newer
    • [iOS][macOS] thanks to the PR from maprohu, the following features are now available
      • the ability to request permissions to show critical notifications
      • the ability to specify the interruption level of a notification. This is only applicable to iOS 15.0 and macOS 12.0 or newer.
    • Updated minimum Flutter version to 2.8 as that aligns with the minimum Dart SDK version of 2.1.5 required by one of flutter_local_notifications_linux's dependencies (dbus)
    • Example app has been updated so that each notification has its own notification ID. Previously, they were all given a notification ID of 0
    • Updated Android setup docs to mention setting up compileSdkVersion
    Source code(tar.gz)
    Source code(zip)
  • flutter_local_notifications-v10.0.0-dev.23(Sep 12, 2022)

    • Fixed issue 1694 where tree-shaking was removing code related to background isolates and thereby preventing notification actions from firing. Readme has also been updated as applications will need to annotate functions invoked by the onDidReceiveBackgroundNotificationResponse callback with the @pragma('vm:entry-point') annotation as well. The example and docs have been updated to remove usages of the IsolateNameServer APIs due to issues in release builds. If anyone knows how to get these working then please submit a PR
    Source code(tar.gz)
    Source code(zip)
  • flutter_local_notifications-v9.9.1(Sep 3, 2022)

  • flutter_local_notifications-v10.0.0-dev.22(Sep 3, 2022)

    • Updated minimum Flutter version to 2.8 as that aligns with the minimum Dart SDK version of 2.1.5 required by one of flutter_local_notifications_linux's dependencies (dbus)
    • Includes changes from 9.9.1
    Source code(tar.gz)
    Source code(zip)
  • flutter_local_notifications-v9.9.0(Aug 29, 2022)

    • [Android] added the ability to specify audio attributes of a notification channel via the audioAttributesUsage property belonging to the AndroidNotificationChannel and AndroidNotificationDetails classes. Thanks to the PR from Jonas Bornold
    Source code(tar.gz)
    Source code(zip)
  • flutter_local_notifications-v10.0.0-dev.21(Aug 29, 2022)

  • flutter_local_notifications-v9.8.0+1(Aug 17, 2022)

    • Added more details to 9.8.0 changelog entry to mention that apps will need to change compileSdkVersion to 33 and also updated readme to mention this
    Source code(tar.gz)
    Source code(zip)
  • flutter_local_notifications-v9.8.0(Aug 17, 2022)

    • [Android] added requestPermission method to the AndroidFlutterLocalNotificationsPlugin class. This make use of the new feature added to Android 13 where an app can request permissions to show notifications. As the plugin's APIs don't have breaking changes, this is released a minor release. It does however, require the Android 13 SDK to be install installed and for apps to change the compileSdkVersion in their app's build.gradle to 33 as the plugin's compileSdkVersion is now 33. Only apps targeting Android 13 can request the permission as well. The latter can be done by updating the targetSdkVersion in an app's build.gradle file to 33. Thanks to the PR from Bartek Pacia. Note: the ability to request the permission as part of calling initialize will be added later on
    Source code(tar.gz)
    Source code(zip)
  • flutter_local_notifications-v10.0.0-dev.20(Aug 17, 2022)

    • Includes changes from 9.8.0
    • [Android] Breaking change the following error codes included in PlatformExceptions that can occur on Android have been updated
    • GET_ACTIVE_NOTIFICATION_MESSAGING_STYLE_ERROR_CODE -> getActiveNotificationMessagingStyle
    • PERMISSION_REQUEST_IN_PROGRESS -> permissionRequestInProgress
    Source code(tar.gz)
    Source code(zip)
  • flutter_local_notifications-v10.0.0-dev.19(Aug 17, 2022)

  • flutter_local_notifications-v10.0.0-dev.18(Jul 31, 2022)

  • flutter_local_notifications-v9.7.0(Jul 10, 2022)

    • [Android] added support to specify notification count via the number property that has been added to the AndroidNotificationDetails class. Thanks to the PR from Katsuya Kato
    • Updated readme so that link to icon design guidance points to the archived version as the original link is now returning 404 not found. Thanks to the PR from Zaldy Pagaduan Jr.
    Source code(tar.gz)
    Source code(zip)
  • flutter_local_notifications-v10.0.0-dev.17(Jul 10, 2022)

  • flutter_local_notifications-v9.6.1(Jul 10, 2022)

  • flutter_local_notifications-v10.0.0-dev.16(Jun 16, 2022)

    • Includes changes from 9.6.1
    • [Android] Breaking change the category of the AndroidNotificationDetails now requires an instance of the newly added AndroidNotificationCategory class instead of a string. This was to improve the discoverability of the APIs and improve the semantics as the category can specified in a similar fashion to using an enum value
    • [Linux] Breaking change the linux notification categories defined by LinuxNotificationCategory no longer has factory constructors but has static constant fields instead to make the semantics more similar to access enum values
    Source code(tar.gz)
    Source code(zip)
  • flutter_local_notifications-v9.6.0(Jun 4, 2022)

  • flutter_local_notifications-v10.0.0-dev.14(May 22, 2022)

    • Includes changes from 9.5.1 to 9.5.3+1
    • Breaking change [Android] zonedSchedule()'s implementation has switched to using desugaring instead of the ThreeTen Android Backport library. This required the plugin to update to using Android Gradle plugin 4.2.2 and applications may need to bump their Android Gradle plugin dependency to at least 4.2.2 as a result. Added a "Gradle setup" section underneath "Android setup" with details on the extra setup needed
    • Fixed progress notification example where the progress bar wasn't updating. Thanks to the PR from Lucas Ribolli
    Source code(tar.gz)
    Source code(zip)
  • flutter_local_notifications-v9.5.3+1(May 14, 2022)

    • Updated example app with to use updated Proguard rules for GSON
    • Update readme about GSON's Proguard rules to recommend referring to the rules on GSON's repository
    • Move note in readme about how onSelectNotification won't be called when an app is launched by a notification so it's more visible
    Source code(tar.gz)
    Source code(zip)
  • flutter_local_notifications-v9.5.3(May 14, 2022)

  • flutter_local_notifications-v9.5.2(May 6, 2022)

Owner
Michael Bui
A developer with a keen interest in building cross-platform applications
Michael Bui
Flutter Downloader - A plugin for creating and managing download tasks. Supports iOS and Android. Maintainer: @hnvn

Flutter Downloader A plugin for creating and managing download tasks. Supports iOS and Android. This plugin is based on WorkManager in Android and NSU

Flutter Community 789 Jan 3, 2023
File picker plugin for Flutter, compatible with both iOS & Android and desktop (go-flutter).

File Picker A package that allows you to use the native file explorer to pick single or multiple files, with extensions filtering support. Currently s

Miguel Ruivo 985 Jan 5, 2023
A Flutter plugin to easily handle realtime location in iOS and Android. Provides settings for optimizing performance or battery.

Flutter Location Plugin This plugin for Flutter handles getting location on Android and iOS. It also provides callbacks when location is changed. Gett

Guillaume Bernos 953 Dec 22, 2022
Flutter geolocation plugin for Android and iOS.

geolocation Flutter geolocation plugin for Android API 16+ and iOS 9+. Features: Manual and automatic location permission management Current one-shot

Loup 221 Dec 27, 2022
Android and iOS Geolocation plugin for Flutter

Flutter Geolocator Plugin A Flutter geolocation plugin which provides easy access to platform specific location services (FusedLocationProviderClient

Baseflow 1k Jan 5, 2023
Flutter Plugin for AR (Augmented Reality) - Supports ARKit on iOS and ARCore on Android devices

ar_flutter_plugin Flutter Plugin for AR (Augmented Reality) - Supports ARKit for iOS and ARCore for Android devices. Many thanks to Oleksandr Leuschen

Lars Carius 222 Jan 4, 2023
Telegram stickers importing Flutter plugin for iOS and Android

TelegramStickersImport — Telegram stickers importing Flutter plugin for iOS and Android TelegramStickersImport helps your users import third-party pro

Iurii Dorofeev 20 Dec 3, 2022
Plugin to retrieve a persistent UDID across app reinstalls on iOS and Android.

flutter_udid Plugin to retrieve a persistent UDID across app reinstalls on iOS and Android. Getting Started import 'package:flutter_udid/flutter_udid.

Leon Kukuk 183 Dec 21, 2022
Support to update the app badge on the launcher (both for Android and iOS)

Flutter App Badger plugin This plugin for Flutter adds the ability to change the badge of the app in the launcher. It supports iOS and some Android de

Edouard Marquez 258 Dec 25, 2022
A Flutter plugin that allows you to add an inline webview, to use a headless webview, and to open an in-app browser window.

Flutter InAppWebView Plugin A Flutter plugin that allows you to add an inline webview, to use an headless webview, and to open an in-app browser windo

Lorenzo Pichilli 2.3k Jan 8, 2023
A Flutter plugin that allows you to check if an app is installed/enabled, launch an app and get the list of installed apps.

Flutter AppAvailability Plugin A Flutter plugin that allows you to check if an app is installed/enabled, launch an app and get the list of installed a

Lorenzo Pichilli 89 Dec 2, 2022
A lightweight Flutter plugin for making payments and printing on MyPos

my_poster ?? my_poster is in beta - please provide feedback (and/or contribute) if you find issues ??️ A lightweight Flutter plugin for making payment

Antonio Mentone 3 Oct 10, 2022
Flutter library for iOS Widgets Extensions. Integrate a Widget into your App 🍏📱

flutter_widgetkit Flutter Library for the iOS ?? WidgetKit framework and Widget Communication Table of Contents ?? Introduction ??‍?? Installation ??‍

Fasky 227 Dec 31, 2022
Plugin to access VPN service for Flutter | Flutter 的 VPN 插件

Flutter VPN plugin This plugin help developers to access VPN service in their flutter app. 本插件帮助开发者在自己的应用内调用 VPN 服务。 The Android part was implemented

Xdea 277 Dec 28, 2022
Community WebView Plugin - Allows Flutter to communicate with a native WebView.

NOTICE We are working closely with the Flutter Team to integrate all the Community Plugin features in the Official WebView Plugin. We will try our bes

Flutter Community 1.4k Jan 7, 2023
Use dynamic and beautiful card view pagers to help you create great apps.

Use dynamic and beautiful card view pagers to help you create great apps. Preview New Feature v1.3.0 Change Alignment Left Center(Default) Right v1.4.

Jeongtae Kim 84 Dec 6, 2022
Flutter Local Notifications - Learn how to implement local notifications into both Android and iOS using flutter_local_notifications plugin.

Flutter Local Notifications Example Flutter Local Notifications - Learn how to implement local notifications into both Android and iOS using flutter_l

Sandip Pramanik 12 Nov 29, 2022
Awesome Notifications add-on plugin to enable push notifications through Firebase Cloud Messaging with all awesome notifications features.

Awesome Notifications FCM Awesome Notifications add-on to send push notifications using FCM (Firebase Cloud Messaging), with all awesome notifications

Rafael Setragni 8 Jan 4, 2023
Ahmed Elsayed 257 Jan 7, 2023
An extension of flutter local notification, to simplify local notifications

Locally flutter local notification Locally helps developers create local notification with flutter on both Android and IOS platforms, it depends on th

Samuel Ezedi 20 Oct 10, 2022