iOS SDK - permission request callback

I'm trying to figure out how to get a callback from UA after the request permission dialog in order to dismiss the screen behind it.

I need to know when the user has tapped either "allow" or "don't allow".

Didn't see anything about this in the docs..

Didn't find what you were looking for?

New post

Comments

3 comments

  • Hi Omer,

    I wanted to ask and see if we could get a little more clarification on the use case you're trying to accomplish?

    In order to provide the best answer to accomplish your use case, knowing more about what you're trying to achieve will definitely help. 

    0
  • Yeah, I have a screen that explains to the user why we need notification permissions.

    When the user chooses to give us permission we call 

    UAirship.push().userPushNotificationsEnabled = true

    Then you display the system's permission dialog.

    I want to dismiss the screen after the user has finished with the system dialog

    0
  • Omer,

    Got it!

    If a user chooses the "Allow" button, typically that calls the didRegisterForRemoteNotifications method.

    The UA SDK will intercept that method, so it won't trigger if you have it in your AppDelegate.

    In order to tell the SDK to not intercept that, you can set up Automatic Integration to disable that, and then you'll be able to get the callback for didRegisterForRemoteNotifications.

    Unfortunately, there is no callback if a user taps the "Don't allow" button. However, you may consider checking the Notification Types that are enabled for that device. Obviously, if no Notification Types are enabled, that would mean that that user is not enabled to receive notifications, and then you can handle the dismissal of the soft ask screen.

    0

Please sign in to leave a comment.