Releases: MaikuB/flutter_local_notifications
flutter_local_notifications-v1.4.0
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 theAndroidNotificationDetails
class has been removed as it was redundant. No changes are needed unless your application was displaying media notifications (i.e.style
was set toAndroidNotificationStyle.Media
). If this is the case, you can migrate your code by setting thestyleInformation
property of theAndroidNotificationDetails
to an instance of theMediaNotificationStyleInformation
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. Thesound
property of theAndroidNotificationDetails
class has changed from being aString
type to anAndroidNotificationSound
type. In this release, theAndroidNotificationSound
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 wasvar 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. theRingtoneManager
APIs) to obtain the URIs they need.
-
-
[Android] BREAKING CHANGE The
BitmapSource
enum has been replaced by the newlyAndroidBitmap
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. thelargeIcon
andlargeIconBitmapSource
properties of theAndroidNotificationDetails
class). This change affects the following classesAndroidNotificationDetails
: thelargeIcon
is now anAndroidBitmap
type instead of aString
and thelargeIconBitmapSource
property has been removedBigPictureStyleInformation
: thelargeIcon
is now anAndroidBitmap
type instead of aString
and thelargeIconBitmapSource
property has been removed. ThebigPicture
is now aAndroidBitmap
type instead of aString
and thebigPictureBitmapSource
property has been removed
The following describes how each
BitmapSource
value maps to theAndroidBitmap
subclassesBitmapSource.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 addedAndroidIcon
abstract class and its subclasses. This change was done for similar reasons in replacing theBitmapSource
enum. This only affects thePerson
class, which is used when displaying each person in a messaging-style notification. Here theicon
property is now anAndroidIcon
type instead of aString
and theiconSource
property has been removed.The following describes how each
IconSource
value maps to theAndroidIcon
subclassesIconSource.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 aBitmapAssetAndroidIcon
subclass to enables the usage of bitmap icons that have been registered as a Flutter asset via thepubspec.yaml
file. -
[Android] BREAKING CHANGE All properties in the
AndroidNotificationDetails
,DefaultStyleInformation
andInboxStyleInformation
classes have been madefinal
-
The
DefaultStyleInformation
class now implements theStyleInformation
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
- [iOS] BREAKING CHANGE Plugin will now throw a
PlatformException
if there was an error returned upon calling the nativeaddNotificationRequest
method. Previously the error was logged on the native side the usingNSLog
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 withflutter_local_notifications
to let the community thatfirebase_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
- [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
- [Android] Fixed issue 512 where calling
getNotificationAppLaunchDetails()
within theonSelectNotification
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
- 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
- Updated API docs for
resolvePlatformSpecificImplementation()
method
flutter_local_notifications-v1.2.0+2
- Make the static
values
propeerty of thePriority
class returnList<Priority>
instead of being dynamic and added API docs for the property.
flutter_local_notifications-v1.2.0+1
- The static
values
properties for theDay
andImportance
classes now returnList<Day>
andList<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
- Added the
resolvePlatformSpecificImplementation()
method to theFlutterLocalNotificationsPlugin
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 theIOSFlutterLocalNotificationsPlugin
andAndroidFlutterLocalNotificationsPlugin
classes have been removed due to addition of theresolvePlatformSpecificImplementation()
- 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
- [iOS] Added
requestPermissions()
method toIOSFlutterLocalNotificationsPlugin
class. This can be used to request notification permissions separately from plugin initialisation. To facilitate this theIOSFlutterLocalNotificationsPlugin
andAndroidFlutterLocalNotificationsPlugin
now expose a staticinstance
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.