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.

Android Issue - when the app is killed, the callback function not triggered when click on notification

See original GitHub issue

Hey,

In Android, when the i click on the notification and the App is killed, the callback function doesn’t triggered.

I did follow all the steps, and all the other staff works good - when the app is in foreground/background the callback triggered fine.

Code:

`FCM.on(FCMEvent.Notification, async notif => { //Not triggered when user click, but does trigger when receive notification (When app killed) if (notif.opened_from_tray) {

console.log(`user clicked on notification`);

} });`

RN version: “0.48.3” react-native-fcm version: “9.1.0” device: Android nexus 5x emulator. App is killed - not running.

Advanced: The message does delivered, and i see the logs - but when click the notification it’s like everything reset.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
evollucommented, Sep 12, 2017

oh. your issue is when you open the app by clicking the notification, you don’t see the notif? THAT notif that launchers the application will be in await FCM.getInitialNotification()

0reactions
evollucommented, Sep 13, 2017

cool

Read more comments on GitHub >

github_iconTop Results From Across the Web

Firebase push notifications callback doesn't work when app is ...
I resolved this by using the .getInitialMessage() function (This is the callback if the app is terminated. My notifications worked when the ...
Read more >
NotificationListenerService - Android Developers
VERSION_CODES#N onward all callbacks are called on the main thread. Prior to N, there is no ... LOLLIPOP this method will no longer...
Read more >
On IOS when the app is closed, when clicking on a received ...
FYI: I have tested official SFMC learning app and looks like sfmc_handleURL callback won't be called when iOS app is not running (killed) ......
Read more >
expo-notifications dont work when app is not working.
I've tried that first, didn't work. I need to send user to a route when they click on a notification, but the event...
Read more >
flutter_local_notifications | Flutter Package - Pub.dev
If they haven't, then these actions may be selected by the user when an app is sleeping or terminated and will wake up...
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