Seems like there is probably an existing cordova solution for this, but I can't find it other than the cordovaBadge plugin - https://github.com/katzer/cordova-plugin-badge - http://ngcordova.com/docs/plugins/badge/
Problem is I have had to remove this plugin due to conflicts with LocalNotifications. (Seems like I can't have them both)
The cordovaBadge has a simple .hasPermission() method. Is there anything else in the cordova library that can do this?
You could use the isRemoteNotificationsEnabled() method of cordova-diagnostic-plugin:
cordova.plugins.diagnostic.isRemoteNotificationsEnabled(function(isEnabled){
    console.log("Push notifications are " + (isEnabled ? "enabled" : "disabled"));
}, function(error){
    console.error("An error occurred: "+error);
});
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With