iOS GCM. After reinstalling app receives notifications from old installations

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.


    This seems like a bug in GCM. Somehow the old registrations subscribed to a topic are not getting cleaned up when you delete the app. You should file a bug here https://github.com/google/gcm/issues.

    链接地址: http://www.djcxy.com/p/32212.html

    上一篇: 如何使用e订阅Amazon SNS主题

    下一篇: iOS GCM。 重新安装应用程序后收到来自旧安装的通知