valerybodak
valerybodak

Reputation: 4413

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:

  1. 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 } }];
  2. After send push, app receive one push

  3. Delete app

  4. Install app again get GCM token Subscribe to a topic
  5. After send push, app receive two push!!!!!

Why I've got two push-notifications? How to unsubscribe from the old subscription?

Thanks in advance.

Upvotes: 0

Views: 356

Answers (1)

evanescent
evanescent

Reputation: 1373

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.

Upvotes: 0

Related Questions