Push notifications in versions prior to Xcode8 worked correctly, but when migrating to swift 3 it no longer registers the Token. My code is the following:
application.registerUserNotificationSettings(UIUserNotificationSettings(types: [.badge, .sound, .alert], categories: nil));
application.registerForRemoteNotifications()
How to register push notifications in Swift 3?
You have to import the framework
UserNotifications
and add the delegateUNUserNotificationCenterDelegate
in the AppDelegate.swift fileRequest user permission
Get the Token