I'm about to test Push notifications in my app. Now it works fine but I also need to test the possibility of the user not accepting push when the system alert is shown. However after first testing the case where the user accepts.
I can delete the app, restart the device and whatnot but the settings seems to remain. When I delete the app it is removed from Notification Center, but right after installing the settings are just as they where before deletion.
I can understand Apples point here in not having this dialogue shown all the time, but seriously; if the user deletes the app and re-installs - thats a manual act and it would not seem like spam if the question got asked again. It did pre-iOS5 anyway.
So:
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 setting the system clock forward a day or more, turning the device off completely, then turning the device back on.
The implementation of how Notification Center stores preferences is private and undocumented, but Since iOS is based on Mac OSX, it probably stores preferences in the same way - as files named based on your applications Identifier in a system directory and NOT in the directory structure for your app. You can verify this by changing the identifier of your app (but not anything else), and checking for the previous preference settings. This is not caching, it's just their chosen implementation of persisting that data. It's highly unlikely that you can do anything to make it 'forget' a preference for a deleted app.
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