-
Notifications
You must be signed in to change notification settings - Fork 254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Amplify.Notifications.Push.onNotificationOpened.listen wont trigger on Android #5474
Comments
Hi @gigamike, sorry to hear you've ran into this issue. We'll investigate it and provide an update here when we can, thanks. |
Hello @gigamike I was unable to reproduce the issue on my Android device, could you please try running this sample app to see if it still occurs. When I run it I get the following logs:
Can you also confirm if this issue occurs when triggering a push notification from your AWS console |
Hi @tyllark , Thanks for reply. Your sample code is almost the same as mine. When sending push message via Pinpoint i.e. Pinpoint -> All projects -> [Project name] -> Test messaging?, I'm receiving this I/FA ( 3621): Application backgrounded at: timestamp_millis: 1726613957096 BUT when I clicked the push message D/AmplifyAuthCognitoPlugin( 3621): [onNewIntent] Got intent: Intent { flg=0x10400000 cmp=au.movinghub.homehub/com.example.homehub.MainActivity (has extras) } Is that really the behavior of Android? Because in IOS, when I clicked the push notification flutter: 🚀 Open Message PushNotificationMessage { So in Android the Open Message PushNotificationMessage is not triggered/listen or I was expecting that when you clicked the push message it will fetch the push payload via Open Message PushNotificationMessage. It only triggers the Foreground Message and Background Message, but not Open Message. Did you add any in AndroidManifest aside from Thanks, |
Hi @gigamike, For permissions
To clarify the intended functionality for both Android and iOS:
Can you please:
|
Hi @tyllark , This one is not working on my end. Yes it triggers onNotificationReceivedInBackground but when I click the push message it doesn't trigger the onNotificationOpened for Android only. For IOS it works. My goal is when users click the push message they will be redirected to a specific screen in my app depending on the push payload i.e. data Confirm if launchNotification is being set incase you are launch the app from a terminated state.
Confirm that you are not getting push notifications to click when receiving a foreground notification.
Any ideas? Thanks, |
Hi @tyllark , Ok, I figure it out. The problem was I'm using newer version of com.google.gms.google-services i.e. plugins { because currently as of writing, Firebase messaging "Add Firebase to your Android app" So I downgraded to 4.3.14 plugins { I/FA (18734): Application backgrounded at: timestamp_millis: 1726704920445 I can trigger now both Background Message and Open Message. Hopefully they can fix the Flutter Amplify documentation i.e. This doesn't work coz of the column symbol i.e. com.google.gms:google-services, it should be com.google.gms.google-services that is why I need to refer to Firebase docs which in them they have updated version Thank you so much |
This issue is now closed. Comments on closed issues are hard for our team to see. |
Description
I'm using Amplify for push notifications. In IOS, when I clicked the push message, it works fine. I can get the push payload i.e.
flutter: 🚀 onNotificationOpened PushNotificationMessage { "title": "Test title", "body": "Test body please ignore", "imageUrl": null, "deeplinkUrl": null, "goToUrl": null, "fcmOptions": null, "apnsOptions": { "subTitle": null }, "data": { "type": "friend_request", "data1": "data21" } }
But when using Android it seems the Amplify.Notifications.Push.onNotificationOpened.listen won't trigger. I just received a message like this
D/AmplifyAuthCognitoPlugin(11095): [onNewIntent] Got intent: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x14400000 pkg=au.movinghub.homehub cmp=au.movinghub.homehub/com.example.homehub.MainActivity (has extras) }
D/AmplifyAuthCognitoPlugin(11095): [onNewIntent] Not handling intent
Here is a sample code
Im using https://docs.aws.amazon.com/aws-sdk-php/v3/api/api-pinpoint-2016-12-01.html#sendmessages to trigger a push which works fine on both IOS and Android.
Categories
Steps to Reproduce
Setup Amplify push notification using Amazon Pinpoint.
Screenshots
No response
Platforms
Flutter Version
3.24.1
Amplify Flutter Version
2.2.0
Deployment Method
Amplify Gen 2
Schema
No response
The text was updated successfully, but these errors were encountered: