Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS - Ask to enable push notifications after initial decline

I would like to know if it's possible to force the "XXXXX would like to send you push notifications" popup from within an app, after an initial decline. The use case is as follows:

  • The user installs the app, gets the alert about push notifications, and declines because they don't know/trust the app yet.

  • They use the app and proactively request within the app to be alerted when something happens (say for example something they want to buy is sold out so they want to be alerted when it is back in stock).

  • So now the user has asked the app to notify them about something specific but has push notifications disabled at the operating system level.

  • So if the user requests an alert, but I detect that they declined alerts on first run, I need to notify them of this and have them turn push notifications on for the alert to work.

  • Ideally, I would like to force the "XXXX would like to send you push notifications alert" at this point (a second time since they installed the app).

  • I guess plan b would be to show them my own message telling them they have to go into their system settings and turn it back on manually in order to receive the alert they want. This is far from ideal.

Any help would be appreciated. Thanks.

like image 420
Joel Avatar asked Jan 27 '12 04:01

Joel


People also ask

How do I get my iPhone notifications to pop up again?

To see and hear these notifications again, swipe left on the notification in Notification Center, tap Options, then tap Unmute. Turn off notifications for an app or notification group: Swipe left on a notification or group of notifications, tap Options, then tap Turn Off.

How do I get push notifications back?

Once you're in the Settings app, tap Notifications. In the resulting screen (Figure 1), tap Notifications. Accessing the Notification History in Android 12. In the next window (Figure 2), enable the Notification History by tapping the On/Off slider until it's in the On position.

How do I turn on notifications on iPhone after not allowing?

Tap an app below Notification Style, then turn Allow Notifications on or off. If you turn on Allow Notifications, choose when you want the notifications delivered—immediately or in the scheduled notifications summary—and turn Time Sensitive Notifications on or off.


1 Answers

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.

like image 126
rob mayoff Avatar answered Sep 18 '22 17:09

rob mayoff