arnesson / cordova-plugin-firebase

Cordova plugin for Google Firebase
http://arnesson.github.io/cordova-plugin-firebase
MIT License
1.01k stars 1.56k forks source link

Can't get notification when app is fully closed #777

Open danijel2017 opened 6 years ago

danijel2017 commented 6 years ago

Hello dear

For the push notification I need this plugin in ionic 3 app. If app is on foreground or background then I can get push notification. But if app is fully closed then I can't get notification. I tested it on samsung j3 and W9 and I can get notification on W9 when app is closed but samsung is not. What is the problem.

Please help me answer

Regards

Flucadetena commented 6 years ago

Hi! I'm using this plug-in in ionic 3 too and just by getting the token y could send FCM from firebase and receive push perfectly. Could you share some code to see what the problem may be.

danijel2017 commented 6 years ago

I am using this plugin https://ionicframework.com/docs/native/firebase/ As you can see sample code I got firebase token when login And then store this in db and if necessary will send push notification with this token.

germanramos commented 6 years ago

I am having exactly the same issue. The callback "onNotificationOpen" is not executed when app is closed and it has to be open when you tap on the notification. Please help!

John-Henrique commented 5 years ago

@soumak77 I get same problem of @germanramos after update cordova-plugin-firebase to new version

SO: Android 6.0 Firebase plugin: 1.0.5 Expected behavior: When app closed, notifications aren't displayed like 'silent mode' Wrong behavior: When app is closed, notifications are displayed (notify user). onNotificationOpen isn't run

ASHFAQPATWARI commented 5 years ago

Similar problem, not able to get notification when app is fully closed.

kaoecoito commented 5 years ago

After many tests and research I located this solution. The problem occurs with some mobile phone models, for example Asus, which use power manager. The power manager blocks the App from receiving notification when it quits.

https://github.com/phonegap/phonegap-plugin-push/blob/master/docs/PAYLOAD.md#chinese-android-phones