title: not recieving notification on device even after registering for fcm token ios
body: <p>Below is my appdelegate (I'm using Swift 3). I am getting the fcm token and apns token successfully. Still notification is not appearing on the device. Can anyone help?</p>
  
  <pre><code>import UserNotifications
  import Firebase
  
  
  @UIApplicationMain
  class AppDelegate: UIResponder, UIApplicationDelegate {
  
      var window: UIWindow?
      let gcmMessageIDKey = "gcm.message_id"
      static var shared: AppDelegate { return UIApplication.shared.delegate as! AppDelegate }
      func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -&gt; Bool {
  
          FirebaseApp.configure()
          Messaging.messaging().delegate = self
          if #available(iOS 10.0, *) {
  
              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()
          let token = Messaging.messaging().fcmToken
          print("FCM token: \(token ?? "")")
          return true
      }
  
  
      func application(received remoteMessage: MessagingRemoteMessage) {
  
          print(remoteMessage.appData)
  
      }
  
      func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any]) {
          if let messageID = userInfo[gcmMessageIDKey] {
              print("Message ID: \(messageID)")
  
          }
          // Print full message.
          print(userInfo)
      }
  
      func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any],
                       fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -&gt; Void) {
  
          if let messageID = userInfo[gcmMessageIDKey] {
              print("Message ID: \(messageID)")
  
          }
  
          print(userInfo)
          completionHandler(UIBackgroundFetchResult.newData)
      }
  
      func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) {
          print("Unable to register for remote notifications: \(error.localizedDescription)")
  
      }
  
  
      func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
          Messaging.messaging().apnsToken = deviceToken
  
      }
  }
  
  
  @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
  
          if let messageID = userInfo[gcmMessageIDKey] {
              print("Message ID: \(messageID)")
  
          }
          print(userInfo)
          completionHandler([])
      }
  
      func userNotificationCenter(_ center: UNUserNotificationCenter,
                                  didReceive response: UNNotificationResponse,
                                  withCompletionHandler completionHandler: @escaping () -&gt; Void) {
          let userInfo = response.notification.request.content.userInfo
          // Print message ID.
          if let messageID = userInfo[gcmMessageIDKey] {
              print("Message ID: \(messageID)")
  
          }
          print(userInfo)
          completionHandler()
      }
  }
  // [END ios_10_message_handling]
  
  extension AppDelegate : MessagingDelegate {
      // [START refresh_token]
      func messaging(_ messaging: Messaging, didRefreshRegistrationToken fcmToken: String) {
          print("Firebase registration token: \(fcmToken)")
      }
  
      func messaging(_ messaging: Messaging, didReceive remoteMessage: MessagingRemoteMessage) {
          print("Received data message: \(remoteMessage.appData)")
      }
  
  }
  </code></pre>