Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get back "Allow Push Notifications" dialog after it was dismissed once?

I am building an app that is heavily relies on APN. Upon the very first start of my app, iOS asks if this app is allowed to use APN (as a result of registerForRemoteNotificationTypes: call). However once dismissed, this dialog is never popping up back. I have to manually go to Settings->Notifications->MyApp to enable/disable things there. So is there a way to avoid this hustle and actually experience what user will experience upon the very first start every time I start my app in debug mode?

like image 431
Schultz9999 Avatar asked Feb 05 '14 08:02

Schultz9999


People also ask

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 restore push notifications on my iPhone?

Go to Settings and tap Notifications. Select an app under Notification Style. Under Alerts, choose the alert style that you want. If you turn on Allow Notifications, choose when you want the notifications delivered—immediately or in the scheduled notification summary.


2 Answers

Here's how Apple say you can do it:

Resetting the Push Notifications Permissions Alert on iOS

The first time a push-enabled app registers for push notifications, iOS asks the user if they wish to receive notifications for that app. Once the user has responded to this alert it is not presented again unless the device is restored or the app has been uninstalled for at least a day.

If you want to simulate a first-time run of your app, you can leave the app uninstalled for a day. You can achieve the latter without actually waiting a day by following these steps:

  1. Delete your app from the device.

  2. Turn the device off completely and turn it back on.

  3. Go to Settings > General > Date & Time and set the date ahead a day or more.

  4. Turn the device off completely again and turn it back on.

like image 178
Eran Avatar answered Sep 19 '22 17:09

Eran


Since time is money and the other methods take FOREVER—just change your bundle ID over and over while debugging, each time notifications will get queried fresh. Once you are satisfied with code return to original bundle ID.


Key Notes from comments below:

  • Temporarily turn off all other Capabilities (like IAP) to get around needing to change the provisioning profile.
like image 21
Albert Renshaw Avatar answered Sep 21 '22 17:09

Albert Renshaw