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 t
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.
Please try using UIApplication's - (void)unregisterForRemoteNotifications method.
This just worked for me in iOS7:
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.
Re-install app
As J S Rodrigues said you could unregister your device any time. Yet I'm not sure why you tried to once again asked for permission. If you're running APN on your own server, then after register your device, a device token from - (void)application:(UIApplication *)app didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken method should be posted to your APN system, once and for all. So if you tried to test if a device token could be posted to your own system, the the unregister method might be needed. Otherwise, not necessary to do that, since the token is recorded in your system, you could just remove it. And every other time the app is launched, a new record will be added to the APN system.
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.
I read once that you have to delete the app completely from your device and wait 24 hours then reinstall it (a complete device turn off is recommended too), this way it will ask you for the permissions again, but I never tried that. Anyway I don't think you really need to get these permissions again, why would you need that?