GCM registration successful on iphone but not ipad

本秂侑毒 提交于 2019-12-12 03:26:24

问题


I have a weird issue where I receive the following error only on an ipad device:

The operation couldn’t be completed. (com.google.iid error 501.)

During the GCM registration process to request a gcm token. i.e.

GGLInstanceID.sharedInstance().tokenWithAuthorizedEntity(gcmSenderID,
                                            scope: kGGLInstanceIDScopeGCM,
                                          options: gcmRegistrationOptions,
                                          handler: gcmRegistrationHandler)

I'm following the example to the letter. The same process works just fine on an iphone. I'm not sure what the difference between the two devices are and why GCM refuses to register on the ipad. Both devices are currently running iOS 9.3.1.

The header file indicates that this error corresponds to:

// Device seems to be missing a valid deviceID. Cannot
// authenticate device requests.
kGGLInstanceIDOperationErrorCodeMissingDeviceID = 501,

However, I'm not sure exactly what that means. Why would the iPad be missing a deviceID, but the iphone is OK?

If anyone has any ideas on why this is happening and can share some insight, I'd greatly appreciate it.

Thanks!


回答1:


In the end we transitioned to Firebase as recommended by Google recently. Everything worked as expected.



来源:https://stackoverflow.com/questions/36464250/gcm-registration-successful-on-iphone-but-not-ipad

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!