ionic-team / ng-cordova

OBSOLETE: Please move to Ionic Native https://github.com/ionic-team/ionic-native
https://github.com/ionic-team/ionic-native
MIT License
3.48k stars 1.05k forks source link

How I got CordovaBadge to work #1027

Open javacado opened 9 years ago

javacado commented 9 years ago

Hello. I am not entirely sure if this is accurate since I made a few edits trying to get the plugin to work correctly, but just in case:

I couldn't get cordovaBadge to work until I changed this line in ng-cordova.js

promptForPermission: function () {
    return cordova.plugins.notification.badge.promptForPermission();
  },

... changed to

promptForPermission: function () {
    return cordova.plugins.notification.badge.registerPermission();
  },
Ionitron commented 8 years ago

Greetings @javacado!

I've closed this issue because my sensors indicated it was old and inactive, and may have already been fixed in recent versions of Ionic. However, if you are still experiencing this issue, please feel free to reopen this issue by creating a new one, and include any examples and other necessary information, so that we can look into it further.

Thank you for allowing me to assist you.

gortok commented 8 years ago

This should be a doc update.

elewin commented 8 years ago

I was having difficulty getting this plugin to work too, and this fixed it for me.

kirkbyers commented 8 years ago

This fix works for me too on android.

badge.promptForPermission () does not call badge.registerPermission() as the docs state it should.

kylesezhi commented 7 years ago

+1

siddharthnaik7 commented 7 years ago

promptForPermission: function () { return cordova.plugins.notification.badge.promptForPermission(); }, ... changed to

promptForPermission: function () { return cordova.plugins.notification.badge.registerPermission(); },

...... Works on few Android devices... Any permanent solution?

royken commented 7 years ago

Thank you all... this saved me after one week of researchs

mathisschuelingkamp commented 7 years ago

+1

mathisschuelingkamp commented 7 years ago

Seems to be requestPermission now :)