Cordova-plugin-firebase: Notification Bar not opening app

Created on 10 Apr 2017  Â·  10Comments  Â·  Source: arnesson/cordova-plugin-firebase

Android 5.X+ When the app is in the background and a message is received, I get a notification in the notification bar but when clicking the notification, the app does not open.

Most helpful comment

Because I had the same issue. If you use http on your server to send your notifications don't forget to remove the click_action from your message object.

All 10 comments

Same issue here

Did you use FCM plugin before ?

yes I did, and then changed to this one. why do you ask?

On 17 Apr 2017 15:53, "Almya" notifications@github.com wrote:

Did you use FCM plugin before ?

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/arnesson/cordova-plugin-firebase/issues/233#issuecomment-294489548,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AHSgOplpVjUMm_1YPGLKhbUudp7OPRQ5ks5rw27YgaJpZM4M4jI-
.

Because I had the same issue. If you use http on your server to send your notifications don't forget to remove the click_action from your message object.

ah brilliant. let me give it a try and will revert.

On 17 Apr 2017 20:18, "Almya" notifications@github.com wrote:

Because I had the same issue. If you use http on your server to send your
notifications don't forget to remove the click_action from your message
object.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/arnesson/cordova-plugin-firebase/issues/233#issuecomment-294549259,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AHSgOlbBcfje9N72XbylkjL_BN2OXP2Dks5rw6zcgaJpZM4M4jI-
.

And first prize goes to Almya!! Thank you so much. The issue is resolved!

@pedrodagraca you're welcome ;)

Yep, the server side had:

    $n = new Notification($title, $body);
    return $n->setClickAction("FCM_PLUGIN_ACTIVITY")->setIcon('fcm_push_icon')->setSound('default');

I changed it to:

    return $n->setIcon('fcm_push_icon')->setSound('default');

And now it works as expected

But what if you have the app in production.
if you remove the click_action old version wont open the app on notification tap, how would we go about defining a click action in cordova?

Same problem here

Was this page helpful?
0 / 5 - 0 ratings

Related issues

danielpalen picture danielpalen  Â·  5Comments

chrissterling picture chrissterling  Â·  3Comments

Zrnik picture Zrnik  Â·  3Comments

eilian92 picture eilian92  Â·  4Comments

rolinger picture rolinger  Â·  3Comments