Bot releases are hidden (Show)
Published by MaikuB over 4 years ago
subtitle
property of the IOSNotificationDetails
class. This property is only application to iOS versions 10 or newerPublished by MaikuB over 4 years ago
Published by MaikuB over 4 years ago
schedule
, showDailyAtTime
and showWeeklyAtDayAndTime
methods has been marked as a deprecated due to problems with time zones,particularly when it comes to daylight savings.zonedSchedule
method to the plugin that allows for scheduling notifications to occur on a specific date and time relative a specific time zone. This can be used to schedule daily and weekly notifications as well. The example app has been updated to demonstrate its usage. Note that to support time zone-based scheduling, the plugin now depends on the timezone
package so that an instance of the TZDateTime
class is required to the specify the time the notification should occur. This should work in most cases as it is IANA-based and native platforms have time zones that are IANA-based as well. To support time zone aware dates on older versions of Android (which use older Java APIs), the plugin depends on the ThreeTen Android Backport library. Once Flutter's support for Android Studio 4.0 and Android Gradle plugin 4.0 has stabilised, the plugin will be updated to make use of desugaring instead of relying on the ThreeTen Android Backport library.androidAllowWhileIdle
boolean argument to the periodicallyShow
method. When set to true, this changes how recurring notifications are shown so that the Android AlarmManager
API is used to schedule a notification with exact timing. When the notification appears, the next one is scheduled after that. This is get around the limitations where the AlarmManager
APIs don't provide a way for work to be repeated with precising timing regardless of the power mode.InitializationSettings
and NotificationDetails
classes no longer have positional parameters but now have named parameters called android
and iOS
for passing in data specific to Android and iOS. There macOS
named parameter has also been added for passing data specific to macOStoMap
method that was used internally to transfer data over platform channels is no longer publicly accessibleDay
AndroidNotificationChannelAction
Importance
(note: as default
is a keyword, what use to be Default
is now defaultImportance
)Priority
(note: as default
is a keyword, what use to be Default
is now defaultPriority
)GroupAlertBehavior
NotificationVisibility
RepeatInterval
IOSInitializationSettings
constructor to prevent null values being passed ine2e
dev dependencyPublished by MaikuB over 4 years ago
RepeatInterval
enum values to use lower camel casingplugin_platform_interface
dependencyPublished by MaikuB over 4 years ago
firebase_messaging
) when the app was in the foreground then I would recommend updating to this version. Thanks to Paweł Szot for picking up the gap in the code in handling the native willPresentNotification
callPublished by MaikuB over 4 years ago
Published by MaikuB over 4 years ago
showWeeklyAtDayAndTime
Published by MaikuB over 4 years ago
createNotificationChannel
within the AndroidFlutterLocalNotificationsPlugin
class. This allows applications to create notification channels before a notification is shown. Thanks to the PR from Vladimir Gerashchenko.deleteNotificationChannel
within AndroidFlutterLocalNotificationsPlugin
class.Published by MaikuB over 4 years ago
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 removedBigPictureStyleInformation
: 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 removedThe 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
Published by MaikuB over 4 years ago
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.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 togetherPublished by MaikuB over 4 years ago
Published by MaikuB over 4 years ago
getNotificationAppLaunchDetails()
within the onSelectNotification
callback could indicating that the app was launched by tapping on a notification when it wasn't the casePublished by MaikuB over 4 years ago
Published by MaikuB over 4 years ago
resolvePlatformSpecificImplementation()
methodPublished by MaikuB over 4 years ago
values
propeerty of the Priority
class return List<Priority>
instead of being dynamic and added API docs for the property.Published by MaikuB over 4 years ago
values
properties for the Day
and Importance
classes now return List<Day>
and List<Importance>
respectively instead of being dynamicPublished by MaikuB over 4 years ago
resolvePlatformSpecificImplementation()
method to the FlutterLocalNotificationsPlugin
class. This can be used to resolve the underlying platform implementation in order to access platform-specific APIs.instance
properties in the IOSFlutterLocalNotificationsPlugin
and AndroidFlutterLocalNotificationsPlugin
classes have been removed due to addition of the resolvePlatformSpecificImplementation()
new
keyword in code snippetsPublished by MaikuB over 4 years ago
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
getNotificationAppLaunchDetails()
is intended to be used more on if a notification from this plugin triggered launch an applicationPublished by MaikuB over 4 years ago
Published by MaikuB over 4 years ago
FlutterLocalNotificationsPlugin.private()
on how it could be used for testingFlutterLocalNotificationsPlugin.private()
named constructor may be of use