Firebase Push Notifications
<p>I've got <code>FCM</code> working, but I can't get the traditional banner notifications working.</p>

<p>Here's what I have in my <code>AppDelegate.swift</code> file:</p>

<pre><code>import UIKit
import Firebase
import UserNotifications

@UIApplicationMain
final class AppDelegate: UIResponder {
  var window: UIWindow?

  override init() {
    super.init()    
    FIRApp.configure()
  }
}

// MARK: - UIApplicationDelegate
extension AppDelegate: UIApplicationDelegate {
  func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -&gt; Bool {
    let authOptions: UNAuthorizationOptions = [.alert, .badge, .sound]
    UNUserNotificationCenter.current().requestAuthorization(options: authOptions, completionHandler: { _, _ in })
    UNUserNotificationCenter.current().delegate = self

    FIRMessaging.messaging().remoteMessageDelegate = self

    application.registerForRemoteNotifications()

    NotificationCenter.default.addObserver(self, selector: #selector(tokenRefreshNotification), name: .firInstanceIDTokenRefresh, object: nil)
    return true
  }

  func tokenRefreshNotification(notification: Notification) {
    if let refreshedToken = FIRInstanceID.instanceID().token() {
      print("InstanceID token: \(refreshedToken)")
    }

    connectToFcm()
  }

  func connectToFcm() {
    FIRMessaging.messaging().connect { error in
      if error != nil {
        print("Unable to connect with FCM. \(error)")
      } else {
        print("Connected to FCM.")
      }
    }
  }

  func applicationDidBecomeActive(_ application: UIApplication) {
    connectToFcm()
  }
}

// MARK: - UNUserNotificationCenterDelegate
extension AppDelegate: UNUserNotificationCenterDelegate {
  func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -&gt; Void) {
    let userInfo = notification.request.content.userInfo

    print("Message ID: \(userInfo["gcm.message_id"]!)")

    print(userInfo)

    completionHandler([.alert, .sound])
  }
}

// MARK:
extension AppDelegate: FIRMessagingDelegate {
  func applicationReceivedRemoteMessage(_ remoteMessage: FIRMessagingRemoteMessage) {
    print("FIRMessagingRemoteMessage Received: \(remoteMessage.appData)")
  }
}
</code></pre>

<p>Everything is configured according to the <a href="https://firebase.google.com/docs/notifications/ios/console-audience" rel="nofollow">documentation</a>. I'm getting console outputs when I send messages to my app via the notifications console on Firebase.</p>

<p>However, banners don't appear when notifications are sent. When the app is backgrounded, notifications don't appear to be sent either - only when the app is in the foreground. </p>

<p>Looking for help. Thanks in advance!</p>