Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cordova PushPlugin - Can't receive GCM notification on android if app is not running

This is my first message here. I'm using Cordova to develop an web application and I would like to receive Push Notification under Android using GCM.

I tried the this plugin : https://github.com/phonegap-build/PushPlugin I tried the example provided and it's working fine when the app is running : - Received notification is shown inside the app if it's running in foreground - Received notification is shown inside the android notification bar is the app is running in background.

My problem: if I restart my smartphone, or if the app is not running, then I cannot receive any notification. Is there something special to do to display notification in the android notification bar when the application is not running or after the phone restarts ?

Thank you very much for your help.

like image 692
Tim Thailand Avatar asked Oct 31 '22 19:10

Tim Thailand


1 Answers

there should be a broadcast receiver in your app for invoke notification service or you can use this https://github.com/phonegap-build/PushPlugin

like image 169
Ashish Singh Avatar answered Nov 09 '22 06:11

Ashish Singh