gpt4 book ai didi

ios - 没有收到 iOS 的 google instance id api 的实例 id

转载 作者:行者123 更新时间:2023-11-28 11:11:36 25 4
gpt4 key购买 nike

我正在为 iOS 集成 google instance id api 并调用适当的方法如下获取实例 ID。

 let gcmConfig = GCMConfig.defaultConfig()
gcmConfig.receiverDelegate = self
GCMService.sharedInstance().startWithConfig(gcmConfig)

GGLInstanceID.sharedInstance().getIDWithHandler { (identity, error) -> Void in 如果让错误=错误{ 打印(错误) } 别的{ self.instanceID = 身份 }

但是我得到了这个错误

Error Domain=com.google.iid Code=1005 "(null)"

我遵循了 this url 上的文档

如有任何帮助,我们将不胜感激。

最佳答案

您找到问题的解决方案了吗?

我遇到了同样的错误,我想通了。它是 Obj-C 代码,但我认为它在 swift 中是相同的。问题是配置初始化。

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];

关于ios - 没有收到 iOS 的 google instance id api 的实例 id,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34632916/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com