Skip to content

Releases: MaikuB/flutter_local_notifications

flutter_local_notifications-v1.4.0

01 Apr 11:02
9c0fdaa
Compare
Choose a tag to compare

Please note that there are a number of breaking changes in this release to improve the developer experience when using the plugin APIs. The changes should hopefully be straightforward but please through the changelog carefully just in case. The steps migrate your code has been covered below but the Git history of the example application's main.dart file can also be used as reference.

  • [Android] BREAKING CHANGE The style property of the AndroidNotificationDetails class has been removed as it was redundant. No changes are needed unless your application was displaying media notifications (i.e. style was set to AndroidNotificationStyle.Media). If this is the case, you can migrate your code by setting the styleInformation property of the AndroidNotificationDetails to an instance of the MediaNotificationStyleInformation class. This class is a new addition in this release

  • [Android] BREAKING CHANGE The AndroidNotificationSound abstract class has been introduced to represent Android notification sounds. The sound property of the AndroidNotificationDetails class has changed from being a String type to an AndroidNotificationSound type. In this release, the AndroidNotificationSound has the following subclasses

    • RawResourceAndroidNotificationSound: use this when the sound is raw resource associated with the Android application. Previously, this was the only type of sound supported so applications using the plugin prior to 1.4.0 can migrate their application by using this class. For example, if your previous code was

      var androidPlatformChannelSpecifics = AndroidNotificationDetails(
        'your other channel id',
        'your other channel name',
        'your other channel description',
        sound: 'slow_spring_board');

      Replace it with

      var androidPlatformChannelSpecifics = AndroidNotificationDetails(
        'your other channel id',
        'your other channel name',
        'your other channel description',
        sound: RawResourceAndroidNotificationSound('slow_spring_board');
    • UriAndroidNotificationSound: use this when a URI refers to the sound on the Android device. This is a new feature being supported as part of this release. Developers may need to write their code to access native Android APIs (e.g. the RingtoneManager APIs) to obtain the URIs they need.

  • [Android] BREAKING CHANGE The BitmapSource enum has been replaced by the newly AndroidBitmap abstract class and its subclasses. This removes the need to specify the name/path of the bitmap and the source of the bitmap as two separate properties (e.g. the largeIcon and largeIconBitmapSource properties of the AndroidNotificationDetails class). This change affects the following classes

    • AndroidNotificationDetails: the largeIcon is now an AndroidBitmap type instead of a String and the largeIconBitmapSource property has been removed
    • BigPictureStyleInformation: the largeIcon is now an AndroidBitmap type instead of a String and the largeIconBitmapSource property has been removed. The bigPicture is now a AndroidBitmap type instead of a String and the bigPictureBitmapSource property has been removed

    The following describes how each BitmapSource value maps to the AndroidBitmap subclasses

    • BitmapSource.Drawable -> DrawableResourceAndroidBitmap
    • BitmapSource.FilePath -> FilePathAndroidBitmap

    Each of these subclasses has a constructor that an argument referring to the bitmap itself. For example, if you previously had the following code

    var androidPlatformChannelSpecifics = AndroidNotificationDetails(
      'your other channel id',
      'your other channel name',
      'your other channel description',
      largeIcon: 'sample_large_icon',
      largeIconBitmapSource: BitmapSource.Drawable,
    )

    This would now be replaced with

    var androidPlatformChannelSpecifics = AndroidNotificationDetails(
      'your other channel id',
      'your other channel name',
      'your other channel description',
      largeIcon: DrawableResourceAndroidBitmap('sample_large_icon'),
    )
  • [Android] BREAKING CHANGE The IconSource enum has been replaced by the newly added AndroidIcon abstract class and its subclasses. This change was done for similar reasons in replacing the BitmapSource enum. This only affects the Person class, which is used when displaying each person in a messaging-style notification. Here the icon property is now an AndroidIcon type instead of a String and the iconSource property has been removed.

    The following describes how each IconSource value maps to the AndroidIcon subclasses

    • IconSource.Drawable -> DrawableResourceAndroidIcon
    • IconSource.FilePath -> BitmapFilePathAndroidIcon
    • IconSource.ContentUri -> ContentUriAndroidIcon

    Each of these subclasses has a constructor that accepts an argument referring to the icon itself. For example, if you previously had the following code

    Person(
      icon: 'me',
      iconSource: IconSource.Drawable,
    )

    This would now be replaced with

    Person(
      icon: DrawableResourceAndroidIcon('me'),
    )

    The AndroidIcon also has a BitmapAssetAndroidIcon subclass to enables the usage of bitmap icons that have been registered as a Flutter asset via the pubspec.yaml file.

  • [Android] BREAKING CHANGE All properties in the AndroidNotificationDetails, DefaultStyleInformation and InboxStyleInformation classes have been made final

  • The DefaultStyleInformation class now implements the StyleInformation class instead of extending it

  • Where possible, classes in the plugins have been updated to provide const constructors

  • Updates to API docs and readme

  • Bump Android dependencies

  • Fixed a grammar issue 0.9.1 changelog entry

flutter_local_notifications-v1.3.0

21 Mar 07:15
ce03b6e
Compare
Choose a tag to compare
  • [iOS] BREAKING CHANGE Plugin will now throw a PlatformException if there was an error returned upon calling the native addNotificationRequest method. Previously the error was logged on the native side the using NSLog function.
  • [iOS] Added ability to associate notifications with attachments. Only applicable to iOS 10+ where the UserNotification APIs are used. Thanks to the PR from Pavel Sipaylo
  • Updated readme on using firebase_messaging together with flutter_local_notifications to let the community that firebase_messaging 6.0.13 can be used to resolve compatibility issues around callbacks when both plugins are used together

flutter_local_notifications-v1.2.2

11 Mar 10:46
7ddfb00
Compare
Choose a tag to compare
  • [Android] Added ability to specify if the timestamp for when a notification occurred should be displayed. Thanks to the PR from mojtabaghiasi

flutter_local_notifications-v1.2.1

05 Mar 11:55
d195f9f
Compare
Choose a tag to compare
  • [Android] Fixed issue 512 where calling getNotificationAppLaunchDetails() within the onSelectNotification callback could indicating that the app was launched by tapping on a notification when it wasn't the case
  • Update example app to indicate if a notification launched the app and include the launch notification payload

flutter_local_notifications-v1.2.0+4

28 Feb 22:32
aa3c384
Compare
Choose a tag to compare
  • Title at the top of the readme is now the same name as the plugin
  • Updated readme to add subsections under the Android and iOS integration guide
  • Added links in the readme under the Android release build configuration section that point to the configuration files used by the example app

flutter_local_notifications-v1.2.0+3

24 Feb 10:02
3ff8714
Compare
Choose a tag to compare
  • Updated API docs for resolvePlatformSpecificImplementation() method

flutter_local_notifications-v1.2.0+2

23 Feb 11:37
9796661
Compare
Choose a tag to compare
  • Make the static values propeerty of the Priority class return List<Priority> instead of being dynamic and added API docs for the property.

flutter_local_notifications-v1.2.0+1

23 Feb 11:20
8316c5a
Compare
Choose a tag to compare
  • The static values properties for the Day and Importance classes now return List<Day> and List<Importance> respectively instead of being dynamic
  • Added more public API documentation
  • Updated readme to move issues and contributions section to the readme within the repository
  • Added screenshots to readme
  • Updated how breaking changes are highlighted in changelog to all the letters aren't capitalised

flutter_local_notifications-v1.2.0

23 Feb 04:48
8f1f54f
Compare
Choose a tag to compare
  • Added the resolvePlatformSpecificImplementation() method to the FlutterLocalNotificationsPlugin class. This can be used to resolve the underlying platform implementation in order to access platform-specific APIs.
  • Breaking change the static instance properties in the IOSFlutterLocalNotificationsPlugin and AndroidFlutterLocalNotificationsPlugin classes have been removed due to addition of the resolvePlatformSpecificImplementation()
  • Updated readme to remove use of new keyword in code snippets
  • Bumped e2e dependency
  • Bumped example app dependencies
  • Make the pedantic dev_dependency explicit

flutter_local_notifications-v1.1.7

22 Feb 03:44
748071f
Compare
Choose a tag to compare
  • [iOS] Added requestPermissions() method to IOSFlutterLocalNotificationsPlugin class. This can be used to request notification permissions separately from plugin initialisation. To facilitate this the IOSFlutterLocalNotificationsPlugin and AndroidFlutterLocalNotificationsPlugin now expose a static instance property that can be used obtain the platform-specific implementation of the plugin so that platform-specific methods can be used. Thanks to the PR from Dariusz Łuksza
  • Updated documentation to clarify that getNotificationAppLaunchDetails() is intended to be used more on if a notification from this plugin triggered launch an application
  • Updated API docs for consistency and to better follow the guidelines on effective Dart documentation.