1
votes

In my testing, I have found that if the user deletes the app, then installs it again, a new installation is created. That is expected.

However, the old Installation is never deleted from the Parse console. Furthermore, the old device token is still valid, because I end up getting duplicate push notifications.

When I manually delete the old Installation form the Parse console, I don't get duplicate push notifications.

According to Hector from Parse, this shouldn't be: When an app is deleted, any push device tokens that belong to it are invalidated, and the Installation object is removed.

https://www.parse.com/questions/how-to-cancel-the-channel-when-the-user-delete-the-application-from-the-device

What's going on here? Is this working for other people?

2
when you generating the push at that time you have to filter out the devices you want to send push notification. - Jaimish
I already am, by using channels. The problem is that the old Installation and the new Installation both have that channel in their array. Because of this (well, because of what I stated in my original question), I am getting duplicate Push notifications. - shadowmoses

2 Answers

1
votes

When a user deletes your app from their device, you have NO way of knowing such action has taken place UNLESS an attempt to send a Push notification to that device for your app fails which then means the user has deleted your app. Apple provides a service called The Feedback service to monitor deleted apps and a Push provider will use this to determine if an app has been deleted. Parse is querying this regularly behind the scenes to determine which device tokens are invalid. However it seems after iOS9, people are facing problems with duplicate Push notifications being sent after an app is being deleted. See: https://forums.developer.apple.com/message/88709

If your app only sends Push notifications to users who have signed up and as long as you can tolerate you app being Installed on one device, you can overcome this issue by making sure only one Installation record is associated with each user. Generally, I think the scenario you are facing does not happen that often in real world where a user deletes and re-installs the app within a short period.

0
votes

Between the caching of installation records, to duplicate records, to orphaned records, it would seem a re-write of the Installation record process is in order.

I had to create a manual setting in config in order to turn off checking that should be safe and automatic via the installation record. It is not. period. So i am faced with having to adding an admin channel to users to allow them to reach out, express an instance of an issue, i can then manually set a config setting to let the code say "ok, you can pass over the bridge now", then carry on.

Not very dev-friendly.