Why “didRegisterForRemoteNotificationsWithDeviceToken” is not getting called n swift 3, iOS 10, XCode 8?

My app has : APP ID - push-notification enabled, Provision Profile (Development) - push-notification enabled, Target - capabilities - push-notification enabled, Target - background mode - background fetch, remote notification enabled


In Appdelegate

1.

import UserNotifications


2.

class AppDelegate: UIResponder, UIApplicationDelegate, UINavigationControllerDelegate, UNUserNotificationCenterDelegate


3.
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { if #available(iOS 10.0, *) { let center = UNUserNotificationCenter.current() center.delegate = self center.requestAuthorization(options: [.badge, .sound, .alert], completionHandler: { (granted, error) in if error == nil { / application.registerForRemoteNotifications() } else { print("\(error?.localizedDescription)") } }) } else { registerForPushNotifications(application) / } }


but

didRegisterForRemoteNotificationsWithDeviceToken
is not get called instead
didFailToRegisterForRemoteNotificationsWithError
is getting call


func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {


Is I am missing something?

Why “didRegisterForRemoteNotificationsWithDeviceToken” is not getting called n swift 3, iOS 10, XCode 8?
 
 
Q