-
-
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
Get onNotification triggered when a remote notification is received #2402
Comments
the reason you are not receiving notification in background or killed is because you are doing the pushNotification.configure after the AppRegistry.registerComponent(appName,()=>App) (ie in App.js). If you do it in index.js, you should receive the notification in all states. It works for me... |
I can't believe it! But it's really a solution! I tried everything I could to find a solution, but it's so simple! I don't understand why there is no mention of it in the documentation and README? How could they forget to mention such an important factor? It's unbelievable. |
Question
Is it possible to make
onNotification
listener to run every time my app receives a remote notification?Currently this behaviour is the behaviour for each app state:
Foreground
Background
Killed/Closed
So, I wanted that onNotification would be called for every remote notification received, doesn't matter the app state. After reading some issues in the repository and some posts on stack overflow, it seems to be possible, but I'm not sure.
If anyone have some idea how to achieve this, please let me know.
My goal is to receive remote notifications, but never show remote notifications to the user, and once onNotification is called, send a localNotification instead.
The text was updated successfully, but these errors were encountered: