iOS – Ask to enable push notifications after initial decline

You can’t make iOS show the alert again. Here’s a better approach:

  1. Keep a flag in your NSUserDefaults indicating whether you should register for push notifications at launch. By default the flag is false.
  2. When you launch, check the flag. If it’s true, register immediately. Otherwise, don’t register.
  3. The first time the user does something that would cause a push notification, register for push notifications and set the flag in NSUserDefaults.

This way, when the user gets the push notifications alert, he has some idea why he’s getting it, and might actually say yes.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)