flutter_local_notifications
flutter_local_notifications copied to clipboard
false positive when using `didNotificationLaunchApp` when performing a hot restart after showing scheduled notif
Describe the bug
When creating a scheduled notif with a payload, showing that notification, then doing a hot restart, the handler for notification tapped gets executed because didNotificationLaunchApp
is true
my code:
class _HomeScreenState extends State<HomeScreen> {
@override
void initState() {
super.initState();
final notifPlugin = locator<FlutterLocalNotificationsPlugin>();
notifPlugin.getNotificationAppLaunchDetails().then((value) {
if (value?.didNotificationLaunchApp ?? false) {
notificationTapped(value?.payload);
}
});
}
To Reproduce Tested on Android with scheduled notifications
- create a notification for 10s from now
- show notification (but don't tap it, you could even delete it and it'll still happen)
- hot restart
- See error