So what does this means. In your app, you need to register for push to obtain the devicetoken. The registration has some options like “alert”, “sound” , “badge” . So when you send out a notification, you can specify the badge counter.
When your app is not running, the device will take over and it will automaticly add the badge number. I’m not sure if the device will alter the badge number when you’re in the app (app is active) and you will recieve the notification. But then ‘$cordovaPush:notificationReceived’ will come in action (with the notification payload).
Also … when your app is not running and you get the notification and you tap on the notification, the device will start your app AND fire the $cordovaPush:notificationReceived so your code can react on it.
Thank you for quick response. That’s what exactly wanted.
By the way, I followed this tutorial.
And I could see that it makes me to download ‘phonegap-plugin-push’ which is not '$cordovaPush’
Preferably I don’t want to change to another plugin but, ‘phonegap-plugin-push’ seems does not have notification method which even working when app is not running.
I’ve got push notifications with $ionicPush working successfully, but the handler is not called while the app is closed nor does the badge update. Would you mind posting your .register() method so I can see what I’m doing wrong?