title: Why do I get multiple active Tokens for my Device with Googles Cloud To Device Messaging Service?
body: <p>I just added C2DM capability to my Android App. </p>
  
  <p>At the moment the following happens if C2DM is started in my App.</p>
  
  <ol>
  <li>My App sends the registration Intent  </li>
  <li>The answer broadcast is received by my app</li>
  <li><p>The device token is retrieved from the intent and sent to my server</p>
  
  <p>From that moment everything is working fine. The client receives the push notifications etc. 
  A problem occurs if the following hapens: </p></li>
  <li><p>The user uninstalls the application without disabling push. (Completely deleting it not only updating)</p></li>
  <li>The user reinstalls the application</li>
  </ol>
  
  <p>If after step 5 a push notification is sent my app still receives this notification. 
  It seems that the token which was retrieved from the previous install is still active and is reconnected to the new instance of my application. </p>
  
  <p>This leeds to the following problem: </p>
  
  <ul>
  <li>A user who reinstalls my app but has no intention of receiving push notifications has no possibility to remove himself from the service because the new instance of the app has no way to unregister the old token from my server. </li>
  </ul>
  
  <p>Is this a bug in the C2DM system or is something wrong in my setup?</p>
  
  <p><strong>Update</strong></p>
  
  <p>I followed Berdons advice and did the following:</p>
  
  <p>For testing purposes only start an unregister Intent every time my app starts up. 
  After I send the unregister intent no push notification from my server is sent to my application. That seems to do the trick, but if I now go the C2DM Settings Screen and turn on push notifications for my app all the old tokens get active again and I receive information that I did not register for in the current installation of my app.</p>
  
  <p><strong>Next Update</strong></p>
  
  <p>It seems I'm not the only one with this problem:</p>
  
  <p><a href="https://stackoverflow.com/questions/6595946/android-c2dm-duplicate-message-to-the-same-device-and-app">Android C2DM : Duplicate message to the same device and App</a></p>
  
  <p>I hoped that Google would manage those tokens in a way that old tokens from the same device get disabled after a new one was issued. I also expect that after I sent an unregister Intent all tokens for that application and that device are marked as invalid or deleted from the Google Server for ever. If this is somehow a design decision by Google for special use cases I don't see please enlighten me.</p>