Swift 3 - device tokens are now being parsed as '32BYTES'

前端 未结 11 2548
广开言路
广开言路 2020-12-13 01:27

I just updated from Xcode 7 to the 8 GM and amidst the Swift 3 compatibility issues I noticed that my device tokens have stopped working. They now only read \'32BYTES\'.

11条回答
  •  既然无缘
    2020-12-13 01:52

    func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
    
        let token = deviceToken.map({ String(format: "%02.2hhx", $0)}).joined()
         print("TOKEN: " + token)
    
    
    }
    

提交回复
热议问题