Upgrading flutter_local_notifications 9 to 10
Breaking9.9.1 → 10.0.0Breaking13Platform1New7Changed5Fixed13Other7
BreakingUpgrade verdict
8 breaking changes and a platform requirement change.
In plain terms
- Error codes reported by the Android plugin have new names, so code that checks the old names must be updated.
- Classes shared by iOS and macOS now use a Darwin prefix instead of IOS or MacOS.
- Notification tap and action handling now uses two new callbacks that receive a response object with more details.
- On Android, scheduled notifications now rely on a newer build feature, so apps may need to update their Android build tools.
Must act Top 4 of 9 that need code or config changes
Dart SDK requirement changed in 10.0.0-dev.22: >=2.12.0 <3.0.0 → >=2.15.0 <3.0.0.
Flutter requirement changed in 10.0.0-dev.22: >=2.2.0 → >=2.8.0.
What you must change
Breaking8
Android PlatformException error codes are renamed, e.g. INVALID_ICON to invalid_icon and GET_ACTIVE_NOTIFICATIONS_ERROR_CODE to unsupported_os_version.
PlatformExceptionINVALID_ICONINVALID_LARGE_ICONINVALID_BIG_PICTUREINVALID_SOUNDINVALID_LED_DETAILSGET_ACTIVE_NOTIFICATIONS_ERROR_CODEGET_NOTIFICATION_CHANNELS_ERROR_CODEGET_ACTIVE_NOTIFICATION_MESSAGING_STYLE_ERROR_CODEgetActiveNotificationMessagingStylePERMISSION_REQUEST_IN_PROGRESSpermissionRequestInProgressinvalid_iconinvalid_large_iconinvalid_big_pictureiOS and macOS classes are renamed with a Darwin prefix, e.g. IOSInitializationSettings becomes DarwinInitializationSettings.
IOSInitializationSettingsDarwinInitializationSettingsCallbacks are reworked into onDidReceiveNotificationResponse and onDidReceiveBackgroundNotificationResponse, both passing a NotificationResponse.
onDidReceiveNotificationResponseonDidReceiveBackgroundNotificationResponseNotificationResponseonSelectNotificationonSelectNotificationActionDarwinNotificationActionOption.foregroundshowsUserInterfaceAndroid zonedSchedule() now uses desugaring instead of ThreeTenABP, requiring Android Gradle plugin 4.2.2 or newer.
zonedSchedule()AndroidNotificationDetails.category now requires an AndroidNotificationCategory instance instead of a string.
AndroidNotificationDetailsAndroidNotificationCategoryNotificationAppLaunchDetails now contains a NotificationResponse instance whose payload belongs to NotificationResponse.
NotificationAppLaunchDetailsNotificationResponseMacOSFlutterLocalNotificationsPlugin.requestPermissions() now only accepts non-nullable parameters defaulting to false.
MacOSFlutterLocalNotificationsPluginrequestPermissions()LinuxNotificationCategory now uses static constant fields instead of factory constructors.
LinuxNotificationCategoryPlatform1
Raises the minimum Flutter version to 2.8, aligning with the Dart SDK 2.1.5 minimum required by the dbus dependency.
dbus