【发布时间】:2018-02-01 18:31:33
【问题描述】:
使用带有搜索栏的标准自动完成代码:
placesClient.autocompleteQuery(searchBar.textField.text!, bounds: nil, filter: filter, callback: {(results, error) -> Void in
if let error = error {
print("Autocomplete error \(error)")
return
}
if let results = results {
for result in results {
print("Result \(result.attributedFullText) with placeID \(result.placeID)")
self.predictions.append(result)
}
}
self.placesTableView.reloadData()
})
已经工作了几个月,今晚开始报这个错误:
自动完成错误 Error Domain=com.google.places.ErrorDomain Code=-2 “Places API 服务器返回了我们无法理解的响应。如果您认为此错误代表错误,请按照说明提交报告在我们的社区和支持页面上 (https://developers.google.com/places/support)。”
UserInfo={NSLocalizedFailureReason=Places API 服务器返回了我们无法理解的响应。如果您认为此错误代表错误,请使用我们社区和支持页面 (https://developers.google.com/places/support) 上的说明提交报告。NSUnderlyingError=0x600000444380 {Error Domain=com.google.places.server.ErrorDomain Code=-1 " (null)" UserInfo={NSUnderlyingError=0x600000444350 {Error Domain=com.google.HTTPStatus Code=404 "未找到" UserInfo={NSLocalizedDescription=未找到}}}}}
还有其他人遇到过这种情况吗?
【问题讨论】:
-
如果你调用place api,那么它就可以工作我在浏览器中调用了place API,但不能使用gmsplacesclient
-
iOS 上的 Google Places API 也遇到了同样的问题。在 Android 上,它运行良好。
-
有同样的问题。一定是服务问题
标签: ios google-places-api