title: Not able to receive notification from firebase in swift3
body: <p>I am not able to receive the notification from firebase. I have updated all pods and also uploaded the APNs Certificates for production. In Xcode i am managing the provisioning profile automatically and also enabled push notification, Remote notification(inside Background modes) in capabilities. Notification is enabled in setting section of device.
  Here is my code in App delegate.</p>
  
  <pre><code> import UserNotifications
   import Firebase
   import FirebaseInstanceID
   import FirebaseMessaging
  
   func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -&gt; Bool {
     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 })
          // For iOS 10 data message (sent via FCM
          Messaging.messaging().delegate = self
      } else {
          let settings: UIUserNotificationSettings =
              UIUserNotificationSettings(types: [.alert, .badge, .sound], categories: nil)
          application.registerUserNotificationSettings(settings)
      }
  
      application.registerForRemoteNotifications()
      FirebaseApp.configure()
  
   }
  
  func application(_ application: UIApplication,     
        didReceiveRemoteNotification userInfo: [AnyHashable: Any]) {
  
      if let messageID = userInfo[gcmMessageIDKey] {
          print("Message ID: \(messageID)")
      }
  }
  
  
  func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -&gt; Void) {
  
       Messaging.messaging().appDidReceiveMessage(userInfo)
  
      // Print message ID.
      if let messageID = userInfo[gcmMessageIDKey] {
          print("Message ID: \(messageID)")
      }
  
      completionHandler(UIBackgroundFetchResult.newData)
  }
  
  func application(_ application: UIApplication,   
    didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
    Messaging.messaging().apnsToken = deviceToken
  }
  
  func applicationDidBecomeActive(_ application: UIApplication) {
      Messaging.messaging().connect { error in
  
      }
  }
  
  @available(iOS 10, *)
   extension AppDelegate : UNUserNotificationCenterDelegate {
  
  // Receive displayed notifications for iOS 10 devices.
  func userNotificationCenter(_ center: UNUserNotificationCenter,
                              willPresent notification: UNNotification,
                              withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -&gt; Void) {
      let userInfo = notification.request.content.userInfo
      //Here i do my navigation according to notification type
   }
  
    func userNotificationCenter(_ center: UNUserNotificationCenter,
                              didReceive response: UNNotificationResponse,
                              withCompletionHandler completionHandler: @escaping () -&gt; Void) {
      let userInfo = response.notification.request.content.userInfo
   }
  
   extension AppDelegate : MessagingDelegate {
  //MARK: FCM Token Refreshed
  func messaging(_ messaging: Messaging, didRefreshRegistrationToken fcmToken: String) {
      let token = Messaging.messaging().fcmToken
      let def = UserDefaults.standard
      def.setValue(token, forKey: KDeviceToken)
      print(def.object(forKey: KDeviceToken) ?? String())
  }
  
  // Receive data message on iOS 10 devices while app is in the foreground.
  func messaging(_ messaging: Messaging, didReceive remoteMessage: MessagingRemoteMessage) {
      NSLog("remoteMessage: \(remoteMessage.appData)")
  }
  }
  </code></pre>