Device Token

Device Token is not generated and the method below is not called even after registering device for notification



func configureNotification(application:UIApplication) {

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: {success, error in

print(error)

print(success)

})

} else {

let settings: UIUserNotificationSettings =

UIUserNotificationSettings(types: [.alert, .badge, .sound], categories: nil)

application.registerUserNotificationSettings(settings)

}

application.registerForRemoteNotifications()

}



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

}

Replies

Restart your device and/or restart XCode...still no joy, it is most likely issues on the backend, solutions including waiting it out & pinging support.


Good luck.