I'm testing Push Notifications right now.
registerUserNotificationSettings
is supposed to ask the user once and only once if "APPNAME would like to send Push Notifications". However, I'm testing my app right now and I need it to ask me again. I've deleted the application from my device, and re-run the application on my device from XCode but I cannot get it to ask me again.
What do I need to delete from my device to get this question to show up again?
I found the answer. https://developer.apple.com/library/ios/technotes/tn2265/_index.html#//apple_ref/doc/uid/DTS40010376-CH1-TNTAG42
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.
Perhaps a rather obvious solution, but if your test device is your main (personal) device, you can test this using the simulator, which is of course very easy to reset.
This would be much faster than turning you device off/on, change date, turn off/on again.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With