title: Background notifications not working on iOS with Flutter package firebase_messaging
body: <p>I've come across many questions like this on StackOverflow and Github, but I haven't found the answer.</p>
  <p>I have an Apple development profile, and I've uploaded APNs Auth Key to Firebase.</p>
  <p>I have enabled Background fetch, Remote notifications and Background processing, as well as Push Notifications in my xCode.</p>
  <p>I have added this two pieces of code to AppDelegate.swift:</p>
  <pre><code>import Firebase
  
  
  if FirebaseApp.app() == nil {
    FirebaseApp.configure()
  }
      ...
  if #available(iOS 10.0, *) {
    // For iOS 10 display notification (sent via APNS)
    UNUserNotificationCenter.current().delegate = self
  
    let authOptions: UNAuthorizationOptions = [.alert, .badge, .sound]
    UNUserNotificationCenter.current().requestAuthorization(
      options: authOptions,
      completionHandler: {_, _ in })
  } else {
    let settings: UIUserNotificationSettings =
    UIUserNotificationSettings(types: [.alert, .badge, .sound], categories: nil)
    application.registerUserNotificationSettings(settings)
  }
  
  application.registerForRemoteNotifications()
  </code></pre>
  <p>I have added this line to Info.plist:</p>
  <pre><code>&lt;key&gt;UIViewControllerBasedStatusBarAppearance&lt;/key&gt;
  &lt;false/&gt;
  </code></pre>
  <p>I've also tried (not working as well):</p>
  <pre><code>key&gt;FirebaseAppDelegateProxyEnabled&lt;/key&gt;
  &lt;string&gt;0&lt;/string&gt;
  </code></pre>
  <p>I have followed the instructions from <a href="https://pub.dev/packages/firebase_messaging" rel="nofollow noreferrer">https://pub.dev/packages/firebase_messaging</a> and I get notifications when my app is in the foreground (onMessage is executed). However, I get no notifications at all when it's in the background. I've tried everything I could find suggested, nothing works. I am really desperate at this point. It doesn't work for the simulator or the real device. Can this even work? If so, please help me get it to.</p>