Upgrading flutter_local_notifications 17 to 18
Breaking17.2.4 → 18.0.1Breaking7Platform4Changed3Fixed1Other1
BreakingUpgrade verdict
6 breaking changes and 2 platform requirement changes.
In plain terms
- Two scheduling methods no longer accept the old androidAllowWhileIdle option, and you must now always specify how the alarm should be scheduled.
- An old iOS-only notification callback is gone because it only worked on very old iOS versions.
- Adds registerWith() to AndroidFlutterLocalNotificationsPlugin.
- Adds registerWith() to IOSFlutterLocalNotificationsPlugin.
Must act Top 5 of 8 that need code or config changes
Dart SDK requirement changed in 18.0.0-dev.1: >=2.17.0 <4.0.0 → ^3.1.0.
Flutter requirement changed in 18.0.0-dev.1: >=3.0.0 → >=3.13.0.
What you must change
Breaking6
Removes the deprecated androidAllowWhileIdle parameter from zonedSchedule() and periodicallyShow(), making androidScheduleMode required.
zonedSchedule()periodicallyShow()androidAllowWhileIdleandroidScheduleModeRemoves the onDidReceiveLocalNotification callback, which only applied to iOS versions older than 10.
onDidReceiveLocalNotificationAdds registerWith() to AndroidFlutterLocalNotificationsPlugin.
AndroidFlutterLocalNotificationsPluginregisterWith()Adds registerWith() to IOSFlutterLocalNotificationsPlugin.
IOSFlutterLocalNotificationsPluginregisterWith()Adds registerWith() to MacOSFlutterLocalNotificationsPlugin.
MacOSFlutterLocalNotificationsPluginregisterWith()Fixes plugin registration so tests on FlutterLocalNotificationsPlugin must manually call the new registerWith() method on each platform implementation.
FlutterLocalNotificationsPluginregisterWith()AndroidFlutterLocalNotificationsPluginIOSFlutterLocalNotificationsPluginMacOSFlutterLocalNotificationsPluginPlatform2
Raises the minimum Flutter SDK requirement to 3.13, which also raises the minimum OS versions for each platform.
Sets the minimum iOS version to 11.
API changes
Generated by DepDelta from published Dart source. Not mixed with prose notes.
- removed:
field DarwinInitializationSettings.onDidReceiveLocalNotification: final DidReceiveLocalNotificationCallback? - changed:
ctor DarwinInitializationSettings({ this.requestAlertPermission = …, this.requestSoundPermission = …, this.requestBadgePermission = …, this.requestProvisionalPermission = …, this.requestCriticalPermission = …, this.defaultPresentAlert = …, this.defaultPresentSound = …, this.defaultPresentBadge = …, this.defaultPresentBanner = …, this.defaultPresentList = …, this.onDidReceiveLocalNotification, thi… → ctor DarwinInitializationSettings({ this.requestAlertPermission = …, this.requestSoundPermission = …, this.requestBadgePermission = …, this.requestProvisionalPermission = …, this.requestCriticalPermission = …, this.defaultPresentAlert = …, this.defaultPresentSound = …, this.defaultPresentBadge = …, this.defaultPresentBanner = …, this.defaultPresentList = …, this.notificationCategories = …, }) - changed:
method FlutterLocalNotificationsPlugin.periodicallyShow( int id, String? title, String? body, RepeatInterval repeatInterval, NotificationDetails notificationDetails, { String? payload, @Deprecated('Deprecated in favor of the androidScheduleMode parameter') bool androidAllowWhileIdle = …, AndroidScheduleMode? androidScheduleMode, }): Future<void> → method FlutterLocalNotificationsPlugin.periodicallyShow( int id, String? title, String? body, RepeatInterval repeatInterval, NotificationDetails notificationDetails, { required AndroidScheduleMode androidScheduleMode, String? payload, }): Future<void> - changed:
method FlutterLocalNotificationsPlugin.zonedSchedule( int id, String? title, String? body, TZDateTime scheduledDate, NotificationDetails notificationDetails, { required UILocalNotificationDateInterpretation uiLocalNotificationDateInterpretation, @Deprecated('Deprecated in favor of the androidScheduleMode parameter') bool androidAllowWhileIdle = …, AndroidScheduleMode? androidScheduleMode, String?… → method FlutterLocalNotificationsPlugin.zonedSchedule( int id, String? title, String? body, TZDateTime scheduledDate, NotificationDetails notificationDetails, { required UILocalNotificationDateInterpretation uiLocalNotificationDateInterpretation, required AndroidScheduleMode androidScheduleMode, String? payload, DateTimeComponents? matchDateTimeComponents, }): Future<void> - added:
static method AndroidFlutterLocalNotificationsPlugin.registerWith(): void - added:
static method IOSFlutterLocalNotificationsPlugin.registerWith(): void - added:
static method MacOSFlutterLocalNotificationsPlugin.registerWith(): void