我在第一次打开应用时才收到此错误
Registration to GCM failed with error: The operation couldn’t be completed. (com.google.iid error 7.)
如果我再次尝试运行该应用程序,我可以注册并获取令牌并接收推送消息。
我已经在unable to register (com.google.iid error 1005.)
上尝试了解决方案但仍有问题。
我知道如何解决这个问题?
由于
编辑: Quickstart示例应用程序上发生了同样的错误
这是来自Quickstart示例应用程序的xcode日志
2015-10-14 15:40:51.722 GcmExampleSwift[680:149607] Successfully configured [CloudMessaging].
2015-10-14 15:40:51.723 GcmExampleSwift[680:149607] Failed to configure [].
2015-10-14 15:40:51.723 GcmExampleSwift[680:149607] Subspecs not present, so not configured [Analytics, AdMob, SignIn, AppInvite, Maps].
2015-10-14 15:40:51.723 GcmExampleSwift[680:149607] Subspecs expected to be present [CloudMessaging, Measurement].
2015-10-14 15:40:51.829: GCM | MCS Registration is not ready with auth credentials
Connected to GCM
Registration to GCM failed with error: The operation couldn’t be completed. (com.google.iid error 7.)
Could not connect to GCM: The operation couldn’t be completed. (com.google.gcm error 2001.)
答案 0 :(得分:0)
我认为你遇到了这个问题,因为我的手机上的时间是将来设置的,一旦设置正确,问题就解决了。
答案 1 :(得分:-1)
如Documentation所述,尝试更改沙箱kGGLInstanceIDAPNSServerTypeSandboxOption
的{{1}}或生产环境的YES
。