title: Push notifications via Firebase not appearing on iOS with app on background
body: <p>We are developing an <code>Ionic</code> app for <code>Android</code> and <code>iOS</code> that has <code>Push Notifications</code>. We send these notifications via <code>Firebase Cloud Messaging</code></p>
  
  <p>On <code>iOS</code> we have this problem (we have accepted Notifications Permission for the app):</p>
  
  <ul>
  <li>When the app is in <code>foreground</code>, we get the notification instantly (we get it inside the app, not with a card).</li>
  <li>When the app is closed or in <code>background</code> it seems like we do not get the notification. However wehn we open or resume the app, we get the notification as is it was recieved with the app in <code>foreground</code>. Our hypothesis is that we are getting <code>silent notifications</code>.</li>
  <li>(When we send Firebase test notification we get the same behaviour).</li>
  </ul>
  
  <p>We have the next configurations:</p>
  
  <blockquote>
    <ul>
    <li>Xcode: Capabilities -> Background Modes -> Remote Notifications (shows one check)</li>
    <li>Xcode: Capabilities -> Push Notifications (shows two checks)</li>
    <li>Apple Developer: Identifiers -> my app -> Push Notifications (with certificates for both dev and prod)</li>
    <li>Apple Developer: Keys -> .p8 key with "Apple Push Notifications service (APNs)"</li>
    <li>Firebase: my app -> Configuration -> Cloud Messaging (.p8 file uploaded with key and team IDs)</li>
    </ul>
  </blockquote>
  
  <p>This is one of the several notifications we have tried to send via Firebase POST API, which combines almost everything we have read while researching this problem. (we also send required Firebase HTTP headers)</p>
  
  <pre><code>{
     "to": "&lt;firebase_token&gt;",
     "notification": {
        "body": "NOTIFICATION BODY",
        "title": "NOTIFICATION TITLE",
     },
     "apns": {
        "headers": {
          "apns-push-type": "alert",
          "apns-expiration": 0,
          "apns-priority": 5,
          "apns-topic": "&lt;my_app&gt;"
        },
        "payload": {
           "alert": {
              "title": "NOTIFICATION TITLE",
              "body": "NOTIFICATION BODY"
           },
           "aps": {
              "content-available": 1,
              "alert": {
                  "title": "NOTIFICATION TITLE",
                  "body": "NOTIFICATION BODY"
               }
           },
           "sound": "default",
           "content-available": 1
        }
     },
     "data": {
        "field": "1",
        "type": "CHAR"
     }
  }
  </code></pre>
  
  <p>Despite this <code>POST</code> request may be incorrect for bacground notifications, we believe that would not be the problem, as Firebase test notifications also fail to show when on background.</p>