How to handle a re-installed app? #203

Closed
liuzhen2008 opened this Issue Oct 4, 2015 · 3 comments

Projects

None yet

2 participants

@liuzhen2008

In my app, I allow users to be logged in. When they log into the app, the notification token will be stored in my database.

But if the user uninstall the app, and re-install the app. (At this point there are no users logged into the app). I noticed that the app will still receive push notifications without the user even opening up the app at all (therefore no javascripts can be executed to stop the app from receiving notifications). Is this a general limitation to push notification? Or can there be some workarounds?

I am currently testing my app with on ios 8, iphone5.

I also noticed that in my re-installed app, the push notification is enabled by default without any confirmation prompts which is different from what other apps are behaving.

Is this something that only happens on development builds?

Any advice and suggestions will be greatly appreciated.

@liuzhen2008 liuzhen2008 changed the title from How to handle a reinstalled app? to How to handle a re-installed app? Oct 4, 2015
@liuzhen2008

I tried to do push.unregister(function(e){console.log(e);}, function(){}) if no users are logged into the app.

I see that the app logs "unregistered", but I am still receiving notifications afterwards. What am I missing here? I'm super confused..

@macdonst macdonst added the retest label Oct 5, 2015
@macdonst macdonst added this to the Release 1.4.0 milestone Oct 5, 2015
@macdonst
Member

@liuzhen2008 for the iOS docs:

You should call this method in rare circumstances only, such as when a new version of the app removes support for all types of remote notifications. Users can temporarily prevent apps from receiving remote notifications through the Notifications section of the Settings app. Apps unregistered through this method can always re-register.

So once you get the success callback from the app you should send a message to your server to remove the registration ID.

As for why they app does not re-prompt you to allow push notifications on re-install that is normal iOS behaviour. From the docs:

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.

You can read up on how to force it to show the dialog again by reading the technical note.

https://developer.apple.com/library/ios/technotes/tn2265/_index.html#//apple_ref/doc/uid/DTS40010376-CH1-TNTAG42

@macdonst macdonst closed this Oct 27, 2015
@liuzhen2008

@macdonst Thank you for your reply! I see!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment