2016-12-29 137 views
0

我得到以下作爲我的日誌,我完全遵循github示例。無法獲取GCM令牌

2016-12-30 03:11:08.585: GCM | GCM library version 1.1.4 
2016-12-30 03:11:08.669: GCM | GCM registration is not ready with auth credentials 
Could not connect to GCM: The operation couldn’t be completed. (com.google.gcm error 501.) 
af442b82bffdf3bc1c1a30189be3edd77c9fe73e0b486b1fad58bdb535a1ea85 
2016-12-30 03:11:25.255376 WeddingLah[6326:1609423] XPC connection interrupted 
Registration to GCM failed with error: Optional("The operation couldn’t be completed. (com.google.iid error 0.)") 
af442b82bffdf3bc1c1a30189be3edd77c9fe73e0b486b1fad58bdb535a1ea85 
Registration to GCM failed with error: Optional("The operation couldn’t be completed. (com.google.iid error 0.)") 

事情我想: 重新生成證書

手動指定開發團隊和輪廓

sanboxOption =真

任何人有任何想法?

我將我的設備令牌包含在我的日誌中,以顯示我確實註冊了我的通知。

+0

嘗試使用FCM,它更容易和新鮮 –

+0

我明白這一點。但不幸的是,這是一個自由的客戶端項目,因此我沒有對FCM或GCM發表意見 – Happiehappie

+0

這是否有幫助:http://stackoverflow.com/questions/34087706/gcm-registration-is-not-ready-with-auth -credentials-in-ios9? https://github.com/googlesamples/google-services/issues/205 – GAEfan

回答

0

除了@ GAEfan我們推薦的鏈接,這SO post說,也許你正在調用

GCMService.sharedInstance().connectWithHandler() { error in if(error != nil) { print(error) } } 

你收到了註冊標記之前,或未能刷新令牌。嘗試refreshing your registration token,看看它是否有效。

您也可以查看這個相關thread

相關問題