2017-02-08 23 views

回答

0

您使用什么函数获取设备令牌?你可能犯了一个小错误。复制粘贴代码有助于。

在你的appDelegate,你应该有这样的事情,

// Called when APNs has assigned the device a unique token 

func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) { 
    // Convert token to string 
    let deviceTokenString = deviceToken.reduce("", {$0 + String(format: "%02X", $1)}) 

    // Print it to console 
    print("APNs device token: \(deviceTokenString)") 

} 
相关问题