-
Notifications
You must be signed in to change notification settings - Fork 101
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
BACKGROUND ISSUE: launching app, that is running in background didnt trigger press event listener #71
Comments
pasting the debug results here:
08-23 22:56:14.547 25764-25764/com.testsample D/ActivityThread: BDC-Calling onReceive: intent=Intent { flg=0x10 cmp=com.testsample/io.neson.react.notification.NotificationEventReceiver (has extras) }, receiver=io.neson.react.notification.NotificationEventReceiver@77a82b3 Thanks In Advance |
Where are you registering your press event listening function? |
In the index page inside alse tried with DeviceEventEmitter |
Hmm. Can you try registering in the constructor? I had a similar issue where it wasn't getting called and that solved it for me. You could also be right about the splash screen activity I haven't experienced this type of scenario so I can't really comment on it though. |
I have used react-native-gcm-android and react-native-system-notification. Aftre research, the root cause could be: If my thought is wrong, please point out. |
@rimzici |
The problem here is the following:
|
@Sh3rawi I've tried your solution with RN 0.39 but I still don't get any events when the notification is clicked when the app is in the background |
@freakinruben, that worked for us at that time. Currently though, we do not use this library anymore. We switched to fcm from gcm, and react-native-fcm has built-in support for local notifications that covers our needs. |
node modules versions:
"react": "^15.2.1",
"react-native": "^0.31.0",
"react-native-system-notification": "^0.2.0",
"react-native-fcm": "^1.0.16",
tried with "react-native": "^0.29.0", also.
have made all config changes told in react-native-system-notification docs.added android:launchMode="singleTask" in manifest file. and issue of app loading every time , even when launching from background got solved, now it resumes. So after that the event listener is not working.
Notification.addListener('press', function(e) {
console.log(e);
});
the listener works when app is running in the foreground. But in the background app launches on clicking notification but event listener not triggered.
Any Suggestions ?
Thanks in advance.
The text was updated successfully, but these errors were encountered: