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 个请求,但我尚未达到。
它是德语,但您可以看到我在过去 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/