无法获取GCM令牌
问题描述:
我得到以下作为我的日志,我完全遵循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 =真
任何人有任何想法?
我将我的设备令牌包含在我的日志中,以显示我确实注册了我的通知。
答
除了@ GAEfan我们推荐的链接,这SO post说,也许你正在调用
GCMService.sharedInstance().connectWithHandler() { error in if(error != nil) { print(error) } }
你收到了注册标记之前,或未能刷新令牌。尝试refreshing your registration token,看看它是否有效。
您也可以查看这个相关thread。
尝试使用FCM,它更容易和新鲜 –
我明白这一点。但不幸的是,这是一个自由的客户端项目,因此我没有对FCM或GCM发表意见 – Happiehappie
这是否有帮助:http://stackoverflow.com/questions/34087706/gcm-registration-is-not-ready-with-auth -credentials-in-ios9? https://github.com/googlesamples/google-services/issues/205 – GAEfan