8
votes

For iOS8 there is option when iOS cache push notification permission for 24h and after reinstall I would not receive push notification alert.

And there is workaround:

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:

Delete your app from the device. Turn the device off completely and turn it back on. Go to Settings > General > Date & Time and set the date ahead a day or more. Turn the device off completely again and turn it back on. Source: https://developer.apple.com/library/ios/technotes/tn2265/_index.html

Q: But for iOS9+ there is no cached push permission, and after reinstall I received alert every time. Is there any option to cache my choice for 24h and use it after reinstall ?

3
best option is when ever your application is install in any device at that time ask all permission that you use in your application like push notificaiton , google map access location services , audio player access etc , photo access ,Himanshu Moradiya

3 Answers

4
votes

No.

Push Notifications permissions alert on iOS normally comes whenever we are registering our app for remote notification.

So once the behavior of permissions alert is changed by respective iOS version, we cant handle it by our own.

I hope this might help you.

3
votes

Push Notifications behavior in iOS 8.0 and iOS 9.0 Or Later.

Solution : 1

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 later 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.

Solution : 2

You can also 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.

Source:

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

0
votes

try setting up a new iCloud account and see if that was it because I had the same problem and so i tried it and the new one would push while the old one would only retrieve if the mail app was open. If that does not help I have contacted the apple software developers and they have not responded you may have to wait until the 9.1 update release.