需要重新实例化一个对象来接受 deviceToken
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
let tmpData = NSData.init(data: deviceToken)
let deviceTokenStr = tmpData.description.replacingOccurrences(of: "<", with: "").replacingOccurrences(of: ">", with: "").replacingOccurrences(of: " ", with: "")
print("deviceTokenStr----->:\(deviceTokenStr)")
}







网友评论