-
Notifications
You must be signed in to change notification settings - Fork 515
iOS: Uninstall and reinstall app causes duplicate push messages #101
Comments
@CeccoCQ thanks for reporting. I can currently reproduce even without uninstall/reinstall and I'm investigating what is going on. I will update this issue when I know more. |
👍 on this. Also another 👍 for all of us because we're all Italians :) |
Any news about this issue? |
We have identified the issue and we are working on a fix, I'll update this thread as soon as it becomes available. |
Any update on this? Still facing this problem |
@silvolu sir when will you update it?? I am getting same issue..Kindly help me |
@mehmoodbahria what version of GCM library are you guys using? |
@mohitsharma0690 i am using pod to configure gcm |
@mohitsharma0690 i am using 7.3.1 version..waiting for your response. |
Having worked through my share of duplicate push notification issues, I have a theory: The GCM token that the app gets probably changes between installs. It can also change periodically even if the app is not reinstalled. The official documentation for GCM says:
This means that even though the GCM token changed, the old one still works. If you don't also send the old device token to your server when you get a new one, chances are good that you will accidentally send a push to both IDs, creating duplicate push messages. Since this is a fresh install, I'm not sure how you are supposed to know what the old ID was, especially since you can't de-register it when the app is being uninstalled. When using the APNS service directly, the old token becomes invalid if a new one is assigned and won't receive any push messages. You are notified one time through the feedback service that the token is no longer valid. Ideally, GCM would de-duplicate pushes sent to both the old token and the updated canonical id, but this would be difficult to do, especially if the two tokens were not contained in the same multicast push message. |
@joshfriend you're somewhat correct. This was the expected behaviour before but we've made changes on our end and you shouldn't see duplicate messages no more (well no more for new registrations, existing registrations which haven't been invalidated would still lead to dupes). Some details, GCM on iOS now maps the APNS token to a unique GCM registration token so if APNS's feedback service tells us that some token is no longer valid the unique GCM registration token associated with it will also be invalidated (as before). But now in the case of app uninstall and re-install if you get back the same APNS token you will get back the old GCM registration token if it can be updated and if not then you will get back a new GCM token along with invalidating the old GCM token. So there shouldn't be any dupes anymore :) I'm going to mark this as closed if you guys see duplicate messages on app uninstall and resinstall (with new tokens) please let us know. |
This is my code:
I've tried with deleteIDWithHandler and deleteTokenWithAuthorizedEntity but without success.
I always receive duplicates messages.
This is the message that I send:
How can I solve?
The text was updated successfully, but these errors were encountered: