Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When I delete my iOS application push notification state remains

When I install my iOS application using Xcode for the first time, my iPhone asks whether I want to enable push notifications.

I am able to send a notification, and the badge shows a number that I sent.

When I delete the application from my iPhone and rebuild it in Xcode and reinstall it again on my iPhone (using Xcode):

  • The device does not ask if I want to enable push.
  • The badge is there and remembers the last number.

I tried the same application on a fresh device (installed the IPA) and it asked me for permissions.

How can I completely make my device forget the application?

Thanks

like image 395
Majid Laissi Avatar asked Sep 11 '12 12:09

Majid Laissi


People also ask

How do I get rid of Apple push notifications?

You can disable push notifications on Android by going into the Settings > Notifications options. Similar to iOS, Android lets you turn off push notifications for individual apps or use a 'Do not disturb' mode.

Do push notifications work when app is closed iOS?

Apple does not offer a way to handle a notification that arrives when your app is closed (i.e. when the user has fully quit the application or the OS had decided to kill it while it is in the background). If this happens, the only way to handle the notification is to wait until it is opened by the user.

Where are iPhone push notifications stored?

Find your notifications in Notification Center To see your notifications in Notification Center, do any of the following: On the Lock Screen: Swipe up from the middle of the screen. On other screens: Swipe down from the top center. Then you can scroll up to see older notifications, if there are any.

Is it possible to detect iOS app uninstall?

How are App Uninstalls detected? You can detect app uninstalls by sending 'silent' push notifications. Silent push notifications are those notifications that aren't rendered on the user's device. You could send a silent push notification daily to all the devices with your app to track uninstalls.


4 Answers

Updated for iOS 7 and later from Apple's docs:

On iOS 7 and later, 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.

For iOS 5 and iOS6:

Reset the push notifications permissions alert by restoring the device from a backup (r. 11450187). Here are the steps to do this efficiently:

  1. Use the Xcode Organizer to install your app on the device. The key is to install the app for the first time without running it.
  2. Use iTunes to back up the device.
  3. Run the app. The push notifications permissions alert will be presented.
  4. When you want to reset the push notifications permissions alert, restore the device from the backup you created in the first step.

https://developer.apple.com/library/content/technotes/tn2265/_index.html

like image 154
Mike Avatar answered Oct 13 '22 17:10

Mike


There is a workaround for this that involves setting the system time ahead by two days, rebooting the device, and then changing the system time back to the present. iOS is designed to only ask permission for push once a day per application.

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.

http://developer.apple.com/library/ios/#technotes/tn2265/_index.html

like image 27
Daddy Avatar answered Oct 13 '22 16:10

Daddy


I was in the same boat you were. What I found most helpful was to slightly change the bundle identifier.

Example: Your bundle identifier is com.company.app. If you need to test enabling push notifications change the identifier to com.company.app1. It will install as a new app and have new push notification permission settings.

Just make sure to change it back when you're done testing.

like image 25
Jake Alewel Avatar answered Oct 13 '22 18:10

Jake Alewel


First of all there is no relation in that iOS remember push settings,badge value and you are not getting push notification. I am sure that there is some other issue. Yes, iOS remembers push settings and badge value for an app. It asks for push confirmation when you first install on device . You can reset badge value by calling setApplicationIconBadgeNumber:

if you want to reset push settings then you can do it by reset all setting of your device.

like image 43
saadnib Avatar answered Oct 13 '22 17:10

saadnib