title: Firebase iOS silent push notification stop to be delivered in background (after a while)
body: <p>My application receives silent push notifications... works fine if the app is in foreground, but when moved to background it only receives them for a while (8-10 minutes) and after nothing for about one hour and after again few received (for 8-10 minutes) and again nothing...</p>
  
  <p>I also realised, that calling</p>
  
  <pre><code>FIRMessaging.messaging().appDidReceiveMessage(userInfo)
  </code></pre>
  
  <p>in background is causing this warning:</p>
  
  <blockquote>
    <p> FIRMessaging receiving notification in invalid
    state 2</p>
  </blockquote>
  
  <p>I am wondering, if these two things can't be linked... Firebase stops sending silent push messages after a while, because they are not confirmed when received in background???</p>
  
  <p>Thanks a lot, Jan</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>One part answered by Firebase support. There is no link between this warning and notifications delivery. Confirmation is used only for Analytics, for nothing else. Warning to be corrected, but not linked to my issue.</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>I have just found these questions, which are describing the issues with silent push notifications delivery in background:</p>
  
  <p><a href="https://stackoverflow.com/questions/26959472/silent-push-notifications-only-delivered-if-device-is-charging-and-or-app-is-for?rq=1">Silent push notifications only delivered if device is charging and/or app is foreground</a></p>
  
  <p><a href="https://stackoverflow.com/questions/20741618/didreceiveremotenotificationfetchcompletionhandler-not-being-called-when-app-is/27074142#27074142">didReceiveRemoteNotification:fetchCompletionHandler not being called when app is in background and not connected to Xcode</a></p>
  
  <p><a href="https://stackoverflow.com/questions/27803520/ios8-1-2-didreceiveremotenotification-method-not-called-when-device-is-not-plugg?noredirect=1&amp;lq=1">iOS8.1.2 didReceiveRemoteNotification method not called when device is not plugged in</a></p>
  
  <p>No obvious solution there... at least I don't see it. </p>