iOS:Google Places Pod - 将 Pod 版本升级到 3.1.0 后出现使用限制错误

标签 ios swift google-places

Google 建议将 iOS Google Places Pod 从 2.7.0 升级到 3.1.0

Version 2.7.0 of the Places SDK for iOS is deprecated as of January 29, 2019, and will be turned off on July 29, 2019

我升级了 Pod,现在遇到了以下问题。

The operation couldn’t be completed. Operation failed due to exceeding the quota usage limit. See the usage limits guide (https://developers.google.com/places/ios-sdk/usage) for information on usage limits and how to request a higher limit.

当我再次将版本降级到 2.7.0 时,使用相同的 API key 一切正常。

我的限制是每天 1000 个请求,但我尚未达到。

enter image description here

它是德语,但您可以看到我在过去 7 天内收到了 142 个请求。

令人困惑的是,当我使用时

placesClient?.currentPlace(callback: { (placeLikelihoodList, error) -> Void in ...

我找到了现在的位置。当我想使用查找自动完成功能时,我受到限制。

placesClient?.findAutocompletePredictions(fromQuery: searchText, bounds: nil, boundsMode: .bias, filter: nil, sessionToken: token, callback: { (gmsAutocompletePrediction, error) in
        if let error = error {
            print(error.localizedDescription) // limit reached error
        }
    })

我是否忽略了什么?我还可以做些什么?我无法想象错误出在 pod 上。

类似的问题没有帮助:

最佳答案

我也遇到了同样的问题。正在尝试实现 Google 的 New Places API 来替换旧 SDK 的地点选择器。每天一两次成功调用后,我总是开始收到以下错误:

An error occurred: The operation couldn’t be completed. Operation failed due to exceeding the quota usage limit. See the usage limits guide (https://developers.google.com/places/ios-sdk/usage) for information on usage limits and how to request a higher limit.

我在控制台中启用了 Places API,并且还启用了使用有效信用卡的计费功能。仍然收到此错误。

解决方案是从 Google Cloud Platform 启用适用于 iOS 的 Maps SDK。从那以后,我的要求就没有限制了,每次都能得到结果。希望对某人有帮助。

关于iOS:Google Places Pod - 将 Pod 版本升级到 3.1.0 后出现使用限制错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56164018/

相关文章:

ios - 从 Firebase 数据库中删除一个值

快速序列类型返回零

ios - 如何使 Xcode 中的 Swift 文件编译成为可选?

android - 在 Google Places API 中获取当前地点类型

google-maps - 嵌入式 Google map 无法在 WebView 中获取当前位置

ios - 从应用程序扩展打印到控制台

ios - 与 NSMutableArray 相比,我可以修改 NSArray 中的数据吗?

ios - 使用 prepareForSegue 将捕获的图像发送到另一个 UIViewController

ios - 如何使用 Firebase 读取推送通知中发送的自定义数据

android - 异常 : 9003: PLACES_API_ACCESS_NOT_CONFIGURED