title: Firebase Cloud Messaging on iOS: Improving message delay for foreground notifications
body: <p>When sending a message with both <code>data</code> and <code>notification</code> payload set, they are displayed as usual when the app is in background. However, when the app is in foreground, they are received in</p>
  
  <pre><code>UNUserNotificationCenterDelegate userNotificationCenter:willPresentNotification:withCompletionHandler:
  </code></pre>
  
  <p>This works fine so far, but the delay between sending and receiving foreground messages is considerably higher than the one we observed on our android application (which also uses Firebase). The reason seems to be that these notifications are always sent via APNS instead of the persistent Firebase connection. </p>
  
  <p>How can I force Firebase to send messages containing both <code>data</code> and <code>notification</code> payloads via their own connection instead of APNS when the app is in foreground?</p>
  
  <p>So basically I want them to behave like pure data messages (which are received in <code>IRMessagingDelegate applicationReceivedRemoteMessage:</code>) when the app is in foreground and still be able to display a notification if it's not.</p>