title: Updating FCM Token on Flutter App
body: <p>I have a Flutter app that creates a FCM Token on the first run, like this:</p>
  
  <pre><code>_firebaseMessaging.getToken().then((token) {
    //save my token here
  });
  </code></pre>
  
  <p>However, I understand that this token can be refreshed once in awhile. In order to get this new refreshed token, I must call <code>onTokenRefresh</code> method:</p>
  
  <pre><code>Stream&lt;String&gt; fcmStream = _firebaseMessaging.onTokenRefresh;
  fcmStream.listen((token) {
    saveToken(token);
  });
  </code></pre>
  
  <p>The problem is that I don't know if this it is correct. The line <code>saveToken(token)</code> is always execute when the app runs, but it works when the app is not on foreground/background? </p>
  
  <p>I mean, this <code>onTokenRefresh</code> will keep listening even if the user closes the app?</p>
  
  <p>If not, how do I get the new token if the app doesn't get started for a long time?</p>