Open tomlocksapps opened 1 month ago
Hi @tomlocksapps, Thank you for submitting this. We will investigate and provide an update when we can.
@tomlocksapps would you please provide answers to the following questions, thanks.
when you click on the push message does it trigger the onNotificationOpened?
No, it’s not called.
do you see the same behaviour without enabling the 'Don't keep activities' option in the system settings and instead reciving a push notification when the app is terminated?
No. When 'Don't keep activities' is OFF then everything works as expected. onNotificationOpened is called.
which google services plugin version do you use and can you please provide the plugin id you use in your gradle file?
id "com.google.gms.google-services" version "4.3.15" apply false
I extracted the logs from the app, so you can see the difference when 'Don't keep activities' is ON/OFF.
Don’t keep activities is OFF App exited through back press -> User clicks the notification
1729011467780 [stdout] flutter: MyApp - initState()
1729011469676 [stdout] flutter: NotificationsInitializer - init()
1729011469679 [stdout] flutter: NotificationsInitializer - init() - Amplify.Notifications.Push.launchNotification
= PushNotificationMessage {….}
Home button clicked inside the app -> notification clicked
1729011343009 [stdout] flutter: NotificationsInitializer - Amplify.Notifications.Push.onNotificationOpened.listen(_handleNotification) called
Don’t keep activities is ON App exited through back press -> User clicks the notification
1729010850440 [stdout] flutter: MyApp - initState()
1729010852958 [stdout] flutter: NotificationsInitializer - init()
1729010852962 [stdout] flutter: NotificationsInitializer - init() - Amplify.Notifications.Push.launchNotification
= PushNotificationMessage {….}
Home button clicked inside the app -> notification clicked
1729010774273 [stdout] flutter: MyApp - initState()
1729010776541 [stdout] flutter: NotificationsInitializer - init()
1729010776542 [stdout] flutter: NotificationsInitializer - init() - Amplify.Notifications.Push.launchNotification
= null
thank you for providing these details. we will look into it and provide update as we have them.
Description
Hi, I'm trying to implement the Push Notifications API in my app, and I've noticed that it doesn't work properly when the activity is destroyed by the system. This issue can be easily reproduced by enabling the 'Don't keep activities' option in the system settings.
I tested it on both an API 34 emulator and a Samsung S21.
Categories
Steps to Reproduce
Screenshots
No response
Platforms
Flutter Version
3.24.3
Amplify Flutter Version
2.4.1
Deployment Method
Amplify Gen 2
Schema
No response