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

前端 未结 11 2550
广开言路
广开言路 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 02:00

    try this

    if #available(iOS 10.0, *) {
       let deviceTokenString = deviceToken.reduce("", {$0 + String(format: "%02X", $1)})
    }
    

提交回复
热议问题