Using the standard autocomplete code using the search bar:
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()
})
It has been working for several months, and today he started reporting this error:
Autocomplete Error Error Domain = com.google.places.ErrorDomain Code = -2 "Places API server returned a response that we could not understand. If you think this error is an error, send a report using the instructions on our community and support page ( https://developers.google.com/places/support ). "
UserInfo = {NSLocalizedFailureReason = API Places , . , , ( https://developers.google.com/places/support). NSUnderlyingError = 0x600000444380 { = com.google.places.server.ErrorDomain Code = -1 "(null)" UserInfo = {NSUnderlyingError = 0x600000444350 { = com.google.HTTPStatus = 404 " " UserInfo = {NSLocalizedDescription = }}}}}
- ?