title: How to unsubscribe from FCM notifications after logout from app?
body: <p>I have implemented Firebase cloud messaging in my app for push notifications. Everything working fine. But notifications are getting even user logged out from app.</p>
  
  <p>I heard that, I need to delete the FCM token when user logged out from app.</p>
  
  <p>So I did like this in logout method:</p>
  
  <pre><code>-(void)logout{
          [[FIRInstanceID instanceID] deleteIDWithHandler:^(NSError *error){
              NSLog(@"%@",error);
          }];
  }
  </code></pre>
  
  <p>But this is not working and next time when user logged in         <code>[[FIRInstanceID instanceID]token]</code> is coming as <code>null</code>.</p>
  
  <p>How to do this?</p>