Phonegap/Cordova disabling notifications on iOS does not work

The API:

UAirship.setUserNotificationsEnabled(enabled, success, failure)

does not seem to work correctly for me. First of all, passing enabled=true does not disable the notifications. I still receive them regardless. Also the success callback is called regardless if user agrees to the push notifications or not.

Didn't find what you were looking for?

New post

Comments

3 comments

  • Hi Michael,

    Setting User Notification to true will not disable push notifications. In fact, it does quite the opposite! Setting it to true will instead register that device for push notifications and prompt the user if they want to receive push or not.

     

    For disabling push, it's not something that is allowed within the app on iOS 8 devices and up, due to some changes Apple made.

    What you'll need to do then, is manually navigate the user to the Settings app on iOS, such that the user can choose to disable push notifications themselves. This is usually done by using the "UIApplicationOpenSettingsURLString" in your app and deep-linking them there.

    Comment actions Permalink
    0
  • Thanks. Yes I meant enabled=false. But your comment about iOS helped. Thanks.

    Comment actions Permalink
    0
  • Michal,

    No problem, happy to help!

    Comment actions Permalink
    0

Please sign in to leave a comment.