I use iOS GCM. After reinstalling the application I receive notification that the application has been signed with the old token.
Steps to reproduce:
- Install app get GCM token: [[GGLInstanceID sharedInstance] tokenWithAuthorizedEntity:_gcmSenderID scope:kGGLInstanceIDScopeGCM options:_registrationOptions handler:_registrationHandler]; Subscribe to a topic: [[GCMPubSub sharedInstance] subscribeWithToken:yourRegToken topic:@"/topics/sample-topic" options:nil handler:^void(NSError *error) { if (error) { int code = error.code; // handle the error, perform exponential backoff // to retry } else { // subscribe successful } }];
After send push, app receive one push
Delete app
- Install app again get GCM token Subscribe to a topic
- After send push, app receive two push!!!!!
Why I've got two push-notifications? How to unsubscribe from the old subscription?
Thanks in advance.
Topic
is associated withregistration token
, every time you reinstall your app, you should get a newregistration token
, and your device will have only one token for your app. So you should not receive push notification twice, because your app only has one token. I tried to reproduce the issue with your provided steps, but I only receive one notification. It is possible that your old notification was delay, and when you send a new one, your app shows 2 notifications. Also, you can provide your HTTP request in your question. – ztan