Hello When the application is installed, it asks the user for permission to send push notifications. I'm testing my application. But after removing it from the device and then install it no longer asks for permission. How do I remove these settings so that it once again asked for permission?
I need it to test server push notifications.
Please try using UIApplication's - (void)unregisterForRemoteNotifications method.
You can as see here: https://developer.apple.com/library/mac/technotes/tn2265/_index.html as below.
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.
the allow dialog for the iOS push notification appear one time every 24 hour .. so all what you need to modify the device date manually and set it to be 1 day after the date that dialog appear on it.
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