在func application(_ application:UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken:Data) 获取到deviceToken后转string时候发现值未nil,打印deviceToken发现值为"32 bytes"
解决方法:
let device_ns =NSData.init(data: deviceToken)
let token:String = device_ns.description.trimmingCharacters(in:CharacterSet(charactersIn: "<>" ))