Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

How to handle a re-installed app? #203

Closed
liuzhen2008 opened this issue Oct 4, 2015 · 4 comments
Closed

How to handle a re-installed app? #203

liuzhen2008 opened this issue Oct 4, 2015 · 4 comments
Labels
Milestone

Comments

@liuzhen2008
Copy link

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 How to handle a reinstalled app? How to handle a re-installed app? Oct 4, 2015
@liuzhen2008
Copy link
Author

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
Copy link
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

@liuzhen2008
Copy link
Author

@macdonst Thank you for your reply! I see!

@lock
Copy link

lock bot commented Jun 5, 2018

This thread has been automatically locked.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

2 participants