You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered an issue when implementing flutter_local_notifications on iOS. The error occurs when initializing DarwinInitializationSettings with the parameter onDidReceiveLocalNotification.
The named parameter 'onDidReceiveLocalNotification' isn't defined.
Try correcting the name to an existing named parameter's name, or defining a named parameter with the name 'onDidReceiveLocalNotification'.
Steps to Reproduce:
Add flutter_local_notifications to pubspec.yaml.
Initialize DarwinInitializationSettings with onDidReceiveLocalNotification.
Run the app on an iOS device.
Observe the compilation error.
Expected Behavior:
The onDidReceiveLocalNotification parameter should either be supported or clearly documented as removed in the latest version. If removed, alternative methods should be provided in the documentation.
Actual Behavior:
The parameter onDidReceiveLocalNotification is not recognized, causing a compilation error.
Proposed Solution:
Update the documentation to clarify that onDidReceiveLocalNotification has been removed.
Suggest using onDidReceiveNotificationResponse instead in the flutterLocalNotificationsPlugin.initialize() method.
Environment:
Flutter Version: 3.24.5
Plugin Version: flutter_local_notifications: ^18.0.1
Platform: iOS
iOS Version: 18.0
Since flutter_local_notifications-v18.0.0 the onDidReceiveLocalNotification has been removed as it was only relevant for older iOS versions (iOS versions older than 10). You have two options to resolve this:
Downgrade to an older version. As you can see here the project uses version 17.1.2
Continue using the latest version by adapting your code to handle notifications without relying on onDidReceiveLocalNotification like you did above.
I encountered an issue when implementing flutter_local_notifications on iOS. The error occurs when initializing DarwinInitializationSettings with the parameter onDidReceiveLocalNotification.
The named parameter 'onDidReceiveLocalNotification' isn't defined.
Try correcting the name to an existing named parameter's name, or defining a named parameter with the name 'onDidReceiveLocalNotification'.
Steps to Reproduce:
Expected Behavior:
The onDidReceiveLocalNotification parameter should either be supported or clearly documented as removed in the latest version. If removed, alternative methods should be provided in the documentation.
Actual Behavior:
The parameter onDidReceiveLocalNotification is not recognized, causing a compilation error.
Proposed Solution:
Update the documentation to clarify that onDidReceiveLocalNotification has been removed.
Suggest using onDidReceiveNotificationResponse instead in the flutterLocalNotificationsPlugin.initialize() method.
Environment:
Flutter Version: 3.24.5
Plugin Version: flutter_local_notifications: ^18.0.1
Platform: iOS
iOS Version: 18.0
For now, I replaced:
with:
and then handled notification with:
The text was updated successfully, but these errors were encountered: