2017-02-08 21 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)") 

} 
相關問題