question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

onMessage not fired when app inactive/killed.

See original GitHub issue

Hello,

Platform Android.

I want to catch info from notification but onNotification passed in .configure(object) is fired only when application is in foreground. Also tried PushNotification.popInitialNotification((notification) => console.log('InitialNotication:', notification)); but in this case I get ‘undefined’. Also if someone knows something about how to show banner on main screen.

"react": "16.13.1", "react-native": "0.63.2", "react-native-push-notification": "^5.1.1",

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6

github_iconTop GitHub Comments

3reactions
Dallas62commented, Sep 21, 2020

You will probably find the solution issues, this is probably related to a splashscreen which intercept the notification.

1reaction
branislavantic87commented, Sep 22, 2020

Ok so when you use react-native-splash-screen it brakes chain and do not pass notification data into main activity on android. So the solution is here https://github.com/crazycodeboy/react-native-splash-screen/issues/289#issuecomment-421537284. Closing issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Firebase onMessageReceived not called when app in ...
This is working as intended, notification messages are delivered to your onMessageReceived callback only when your app is in the foreground.
Read more >
Receive messages in an Apple app - Firebase - Google
// If you are receiving a notification message while your app is in the background, // this callback will not be fired till...
Read more >
Cloud Messaging | React Native Firebase
When the application is in a background or quit state, the onMessage handler will not be called when receiving messages. Instead, you need...
Read more >
Firebase onMessageReceived not called when app in ...
I'm able to see notification on the system tray when my app is in background but not triggering onMessageReceived call back when app...
Read more >
Handling Firebase Notification Messages in Your Web App
onMessage (function(payload) { console.log("Message received. ", payload); // ... }); onBackgroundMessageHandler is called when your app is ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found