Notification Center Caching Settings?

I am going to test push notifications in my application. Now it works fine, but I also need to check the possibility that the user will not accept push when a system warning is displayed. However, after the first test case, when the user accepts.

I can delete the application, reboot the device and something else, but the settings remain. When I delete an application, it is deleted from the Notification Center, but immediately after setting the settings, they are exactly the same as before the removal.

I can understand that Apples indicate that this dialogue is not shown constantly, but seriously; if the user uninstalls the application and reinstalls it - this is a manual action, and it does not look like spam if the question is asked again. In any case, he made pre-iOS5.

So:

  • Does the notification center mean these settings?
  • If so, for how long?
  • And most importantly: can I somehow make it check? (setting the device date to the future?)
+4
source share
2 answers

The implementation of the method for saving Notification Center settings is private and undocumented, but since iOS is based on Mac OSX, it probably saves preferences the same way - like files named based on your applications. Identifier in the system directory, NOT in the directory structure for your application. You can verify this by changing the identifier of your application (but not something else) and checking the previous preference settings. This is not caching, but simply their chosen implementation of this data. It is very unlikely that you can do anything to β€œforget” the preference for the remote application.

+1
source

Reset push notification alerts on iOS
The first time a push-enabled app registers for push notifications, iOS asks the user if they want to receive notifications for this app. As soon as the user replied to this warning, he will not be resubmitted unless the device is restored or the application is uninstalled for at least one day.

If you want to simulate the first launch of your application, you can leave the application deleted for a day. You can achieve the latter without waiting for the day, setting the system clock in advance for a day or more, turning off the device completely, and then turning on the device again.

+7
source

Source: https://habr.com/ru/post/1389889/


All Articles