Upgrading flutter_local_notifications 8 to 9
Breaking8.2.0 → 9.9.1Breaking9Security1Platform4New10Changed6Fixed16Other15
BreakingUpgrade verdict
8 breaking changes and 4 platform requirement changes and a security fix.
In plain terms
- AndroidIcon becomes generic AndroidIcon<T>, its icon property is renamed to data, and Person.icon is now AndroidIcon<Object>?.
- If you set up notifications using settings meant for a different platform, the app now gives a clear error explaining what went wrong instead of crashing with a vague exception.
- A field added to the Android notification info in version 9.1.0 has been removed again, because it could break existing apps. It will come back in a future major version.
- Callback functions you provide no longer need to return a Future; they just run and finish.
Must act Top 5 of 13 that need code or config changes
What you must change
Breaking8
AndroidIcon becomes generic AndroidIcon<T>, its icon property is renamed to data, and Person.icon is now AndroidIcon<Object>?.
AndroidIconAndroidIcon.iconAndroidIcon.dataPerson.iconCalling initialize() with the wrong platform's initialisation settings now throws an ArgumentError instead of an unhandled exception.
initialize()ArgumentErrorReverts the 9.1.0 change that added groupKey to ActiveNotification because it was potentially breaking; it will return in a major release.
ActiveNotificationgroupKeySelectNotificationCallback and DidReceiveLocalNotificationCallback typedefs now return void instead of Future<dynamic>.
SelectNotificationCallbackDidReceiveLocalNotificationCallbackVoidCallbackMakes AndroidNotificationChannel.description and AndroidNotificationDetails.channelDescription named parameters, fixing issue 1306.
AndroidNotificationChannel.descriptionAndroidNotificationDetails.channelDescriptionAndroidNotificationChannelAndroidNotificationDetailsdescriptionchannelDescriptionThe value property of the Importance class is now non-nullable.
Importance.valueRemoves the private FlutterLocalNotificationsPlugin.private() test constructor; platform is now detected via defaultTargetPlatform.
FlutterLocalNotificationsPlugin.private()defaultTargetPlatformdebugDefaultTargetPlatformOverrideMakes AndroidIcon a generic class AndroidIcon<T>, changing the type of Person.icon from AndroidIcon? to AndroidIcon<Object>?.
AndroidIconAndroidIcon<T>AndroidBitmap<T>PersonPerson.iconSecurity1
Bumps the Android gson dependency to 2.8.9, fixing CVE-2022-25647.
gsonPlatform4
Adds details to the 9.8.0 changelog noting apps must set compileSdkVersion to 33, and updates the readme to mention this.
compileSdkVersionRequires the Android 13 SDK and compileSdkVersion 33 in the app's build.gradle because the plugin's compileSdkVersion is now 33.
compileSdkVersionAdds Android 12 support.
Adds Android 12 support.