Swift3.0 didRegisterForRemoteNot

2017-10-26  本文已影响14人  申申申申申

需要重新实例化一个对象来接受 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)")
    }
上一篇 下一篇

猜你喜欢

热点阅读