-
-
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
onNotification not called when clicking on GCM notification while app is in the background #681
Comments
From what I've seen the onNotification callback is triggered only when you run a Release variant... |
I tried running it with Does it just not work on simulators? |
It worked with a emulator for me.. How did you do the check? You can show a toast from the callback to see if it is called. |
onNotification works and prints notification object, but localNotifications but won't display the notification on my older physical ipad device. Any suggestions. |
@hedaktibo I was checking using a console log inside the on notification, then watching the android logs. |
Well.. you can't really debug a release variant, that's why I suggested to show a toast (ToastAndroid) with the notification data from the callback, not a console.log. |
Just did a toast. Doesn't trigger when a notification comes in while app is in the background, and you click on that notification. It does get triggered when the app is open and you get a notification, though. |
Just tried it on a real android phone using |
I'm receiving the notification, but it doesn't pop-up. This is not useful
on IOS since there's no indication that a notification has been received
which is at least present on android.
…On Thu, Mar 22, 2018, 3:17 PM Noah Prince ***@***.***> wrote:
Just tried it on a real android phone using react-native run-android
--variant=release. Still no toast.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#681 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AXnGLp5tBn90w4gp0nbiw2PGpuR8gAfEks5tg_jBgaJpZM4Swgla>
.
|
any update? |
React Native Push Notifications clearly states that we need to call configure outside of the React Native Lifecycle. This is very important. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 30 days if no further activity occurs. Thank you for your contributions. |
I'm on version 3.0.2
When I send a GCM notification via node-pushnotification, I receive the notification on my android simulator.
When I click the notification (app is running in the background), it opens the app but does not call onNotification. I've tried with both popInitialNotification true and false, no dice.
I've gone through #652 #495 #490 #72, and several others in my googling; but not found why this isn't working. My code below includes several suggestions from these other threads.
I've set up a separate
pushNotification.js
file that gets included inindex.js
to make sure it gets set up immediately, then my component consumes via the default export:I tried setting up an intent filter like in some of the comments that say their problems were solved, so that maybe I could at least have the push info in my initial props. No dice:
My server side code:
Since this wasn't able to get answered on StackOverflow, I'm guessing this must be some kind of bug with the library.
Interestingly, local notifications do trigger onNotification, even when the app is in the background. So maybe this has something to do with my server code? Or with GCM specifically?
The text was updated successfully, but these errors were encountered: