-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Push Notification onNotification and onNotificationOpened not called when app is in killed or background state #10371
Comments
This looks identical to #7018 Can you see if this comment helps you out? I am going to close this issue in favor of the previous one but if you're still having the issue after following that thread, feel free to comment there |
Are you running in to this issue on iOS or android? Is this on physical devices or on emulators? |
Im running this on a physical device but in debug mode, im sending notifications from through https://fcm.googleapis.com/fcm/send |
Not sure if it might help, but if i handle the logic in https://github.com/invertase/react-native-firebase/tree/main/packages/messaging it works fine for foreground background but not in quit state |
Seems to be slightly different from the linked issue as yours is happening for the quit state and for both onNotification and onNotificationOpened Just curious if you've tried it on your physical device not in debug mode? |
Hi, yes i tried still no notification |
A similar issue had the resolution outlined here I didn't see this step in the guide you followed. It is supposed to auto-configure but may not be for some reason |
Tried to implement with that, but it's still not working |
I have the same problem, opened is only called with app minimized. Already with fully closed app it doesn't work on android |
@ChengZh98 @arthurhts |
@tannerabread used version 4.3.18 push-notification |
@arthurhts can you try version (4.3.26) and see if that solves the problem? this comment asking about the version has not had anyone test if it works |
@tannerabread |
@arthurhts It seems like there isn't. We are working on triaging the issue though and I'll update this issue when I know more |
@ChengZh98 |
@ChengZh98 @arthurhts npx envinfo --system --binaries --browsers --npmPackages --duplicates --npmGlobalPackages |
@tannerabread : You didn't ask me specifically but we are having the same problem. Output of above command:
|
Yes, this is the same issue on our side. This issue is the symptom we are seeing (onNotification not being called), the #10252 issue is what we see when we debug the notification handler and can see the exception being thrown. |
@ChengZh98 @jim-jigx @arthurhts After speaking with another engineer, I was informed that sending through the FCM console is unlikely to work because it sends a different type of message than what Amplify is expecting. {
notification: {
title: 'foo',
body: 'bar'
}
} while Amplify is designed to handle messages objects like: {
data: {
'pinpoint.notification.title': 'foo',
'pinpoint.notification.body': 'bar'
}
} There's no way that we know of that you can send the expected type through the FCM console. Additionally, when sending messages through the Pinpoint console, it is better to use the |
@tannerabread : We are not using the FCM console to send messages. We have an AWS lambda function that constructs the message and sends it to Amplify. The message we send look something like: |
Hi @ChengZh98, @jim-jigx, @arthurhts, the fix from #10252 has been released and seems to have solved that issue. If this issue was the same root cause it should be cleared. From my own testing both of these callbacks fire. Can someone check if it solves this issue as well? I also never got any android versions in this thread. Can someone verify if this issue was happening on Android SDK 31+ |
Before opening, please confirm:
JavaScript Framework
React Native
Amplify APIs
Push Notifications
Amplify Categories
notifications
Environment information
Describe the bug
When the app is in background/quit state, onNotification and onNotificationOpened is not triggered,
RNPushNotificationMessagingService is not CALLED
Expected behavior
onNotification or onNotificationOpened are triggered
Reproduction steps
Followed this installation guide https://docs.amplify.aws/lib/push-notifications/getting-started/q/platform/js/#setup-for-ios
Sent a notification through aws console or postman
Code Snippet
// Put your code below this line.
Log output
aws-exports.js
No response
Manual configuration
No response
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response
The text was updated successfully, but these errors were encountered: