我正在集成iOS版的google实例id api,并调用如下适当的方法来获取实例id。
let gcmConfig = GCMConfig.defaultConfig()
gcmConfig.receiverDelegate = self
GCMService.sharedInstance().startWithConfig(gcmConfig)
GGLInstanceID.sharedInstance()。getIDWithHandler { (identity,error) -
然而,我得到了这个错误
Error Domain=com.google.iid Code=1005 "(null)"
我遵循了这个url上的文档
任何帮助将不胜感激。
你找到解决问题的方法了吗?
我遇到了同样的错误,我想通了。这是Obj-C代码,但我假设它在swft中是一样的。问题是配置初始化。
GGLInstanceIDConfig *config = [GGLInstanceIDConfig defaultConfig];
[[GGLInstanceID sharedInstance] startWithConfig:config];
GGLInstanceID *iidInstance = [GGLInstanceID sharedInstance];
GGLInstanceIDHandler handler = ^void(NSString *identity, NSError *error) {
if (error) {
NSLog(@"error %@", [error description]);
} else {
// handle InstanceID for the app
NSLog(@"Success! ID = %@", identity);
}
[iidInstance getIDWithHandler:handler];