title: How to handle unregistering of push notifications?
body: <p>Owning an Ionic application (cordova), I'm using this <a href="https://github.com/phonegap-build/PushPlugin" rel="nofollow">plugin</a> to handle pushing of notifications.</p>
  
  <p>I'm confused regarding the <code>unregister</code> function. </p>
  
  <p>Reading the <a href="http://developer.android.com/google/gcm/gcm.html" rel="nofollow">official GCM documentation</a>: </p>
  
  <blockquote>
    <p>You should only need to unregister in rare cases, such as if you want
    an app to stop receiving messages, or if you suspect that the
    registration ID has been compromised. In general, once an app has a
    registration ID, you shouldn't need to change it.</p>
  </blockquote>
  
  <p>For those reasons: </p>
  
  <blockquote>
    <ul>
    <li>A registration ID isn't associated with a particular logged in user.    If you unregister and then re-register, GCM may return the same ID or 
    a different ID—there's no guarantee either way.</li>
    <li>Unregistration may take up to 5 minutes to propagate.</li>
    <li>After unregistration, re-registration may again take up to 5 minutes    to propagate. During this time messages may be rejected due
    to the    state of being unregistered, and after all this, messages
    may still    go to the wrong user.</li>
    </ul>
  </blockquote>
  
  <p><strong>So I wonder why there is the functionality of unregistering client if this is really not recommended.</strong> </p>
  
  <p>Indeed, logically, by reading that, I think about implementing a custom unregister function at client side like the following pseudo-code: </p>
  
  <pre><code>function unregister() {
       deleteRegistrationIdFromServerDatabaseOnly();
  } 
  </code></pre>
  
  <p>=> no need to unregister the client itself.</p>
  
  <p>Indeed, as it exists a mapping on the server database between <code>registrationId</code> and <code>userId</code>, by just emptying the <code>registrationId</code> value, no message would be sent to the client any more; what is expected.<br>
  Therefore, the only way to expect notifications again would be to let the client register again.</p>
  
  <p>So, I repeat, what is the need/use case of unregistering the client itself?</p>
  
  <p>It's really not clear. </p>