I am using this code to get the Notification Center Device token.
It was working in Swift 3 but not working in Swift 4. What changed?
if #available(iOS 1
To get device token
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) { // Convert token to string let deviceTokenString = deviceToken.reduce("", {$0 + String(format: "%02X", $1)}) }
Hope this will help you