GooglePlaces API "Response That We Couldn't Understand" Error - ios

Using the standard autocomplete code with a searchbar:
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()
})
Has been working for months and tonight it started reporting this error:
Autocomplete error Error Domain=com.google.places.ErrorDomain Code=-2 "The Places API server returned a response that we couldn't understand. If you believe this error represents a bug, please file a report using the instructions on our community and support page (https://developers.google.com/places/support)."
UserInfo={NSLocalizedFailureReason=The Places API server returned a response that we couldn't understand. If you believe this error represents a bug, please file a report using the instructions on our community and support page (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 "Not Found" UserInfo={NSLocalizedDescription=Not Found}}}}}
Anyone else experiencing this?

Looks like the service is back up. I raised a ticket with Google.
They identified the issue and are resolving it. Mentioned it could take a few hours.
See below:
https://issuetracker.google.com/issues/64280749
https://issuetracker.google.com/issues/64994023

This issue has been filed with Google, Google has identified the bug, and they are currently working on a fix. Issue tracking: https://issuetracker.google.com/issues/64280749
See: why loading places in iOS using google places api causes lookup place id query error?
thank-you: #trishcode

Related

Not able to sign in with AWSMobileClient iOS. Getting AWSMobileClientError error 13

I'm using the AWSMobileClient on iOS for authentication and I'm not able to sign in. I'm calling the signin method and all I'm getting is the following error:
The operation couldn’t be completed. (AWSMobileClient.AWSMobileClientError error 13.)
This error is useless to me and I can't find any decent documentation on what this error means. Has anyone seen this? Appreciate your help.
Please take a look at this https://github.com/aws-amplify/aws-sdk-ios/issues/1538#issuecomment-491905913
You can cast the error as AWSMobileClientError and switch on it to exhaust the list of errors.
Alternatively, I've moved over the internal message property over to my app like this:
https://github.com/lawmicha/iOS-User-Authentication-with-Email-Facebook-Google/blob/master/AmplifyUserAuthentication1/Internal/ErrorMapper.swift
extension AWSMobileClientError {
var message: String {
switch self {
case .aliasExists(let message),
.badRequest(let message),
and then I can access the message on error after casting it to AWSMobileClientError from if let error = error as? AWSMobileClientError
You should keep in mind that the alternative method exposes the message which is a developer facing message and not a end-user facing message. Ideally when you need to provide an end-user facing message, you would use first method and map the error case to a specific localized message.

Issue with AWSCognito/DynamoDB (Unauthenticated access - not supported)

I am trying to use AWSCognito and DynamoDB in an iOS app.
I have followed this document.
appearently with no problem until step 5 (Create a user pool group).
For:
Step 6: Amazon DynamoDB row-level authorization
I don't quite understand what I am supposed to do.
When running this Swift code:
dynamoDbObjectMapper.save(newMyObject!, completionHandler: {
(error: Error?) -> Void in
if let error = error {
print("Amazon DynamoDB Save Error: \(error)")
return
}
print("An item was saved.")
})
I get this error:
Amazon DynamoDB Save Error: Error Domain=com.amazonaws.AWSCognitoIdentityErrorDomain
Code=8 "(null)" UserInfo={__type=NotAuthorizedException, message=Unauthenticated
access is not supported for this identity pool.}
But I do not intend to have "Unauthenticated access".
I was expecting to be asked for a username/password at some point.
I must have either done something wrong on the way or not done something I should've done.
The fact is I have no experience setting up AWSCognito/DynamoDB to work together.

iOS Swift: Can't create pinterest pin with PinterestSDK

I am experiencing issue while trying to create pin with Pinterest SDK, I use this code:
PDKClient.sharedInstance().createPin(with: imageToShare, link: URL.init(string: "https://someUrl"), onBoard: "MyBoard", description: "",
progress: { (percent) in
}, withSuccess: { (response) in
print("Success")
}) { (error) in
if let error = error {
print(error)
}
}
And I receive this particular response:
Error Domain=com.alamofire.error.serialization.response Code=-1011
"Request failed: not found (404)" UserInfo
{NSLocalizedDescription=Request failed: not found (404),
NSErrorFailingURLKey=https://api.pinterest.com/v1/pins/
User is logged in into Pinterest application, just before calling this line of code, I am able to successfully create board with name MyBoard via the same API, but I am stuck within creation of the pin.
I tried to create pin with image url (because I thought that maybe it is because of my image), but it outputs the same response.
I am using twitter and facebook sdk within the same code, Info.plist seems allright.
Any clues?
Apparently the problem was, that onBoard actually requires not a board name, but it's identifier. So when you create pin board programatically -- (PDKClient.sharedInstance().createBoard) you should fetch and save it's identifier, which can be fetched in response (response.board().identifier).
I was stuck within this problem for the past 1.5 hours and figured it out just after posting the question :) I think it can be useful for someone else, because official SDK wiki is not very informative and git repository is quite dead too.

Google Places Api Error in Swift 3

Google Places Api
I am implementing google place api in my project. I have implemented everything but google Api returns the following error:
Current Place error: The operation couldn’t be completed. An internal
error occurred in the Places API library. If you believe this error
represents a bug, please file a report using the instructions on our
community and support page
(https://developers.google.com/places/support).
It was working earlier but suddenly it stops. I found nothing in any other answer that could be helpful for me.
This my code to call the Api:
GMSPlacesClient().currentPlace(callback: {
(placeLikelihoods, error) -> Void in
guard error == nil else {
print("Current Place error: \(error!.localizedDescription)")
return
}
})
Any Help would be appreciated!!
Make sure that you have given place_id instead of id.
This solved my issue
According to the GMSPlacesClient reference (https://developers.google.com/places/ios-api/reference/interface_g_m_s_places_client) you should be accessing the shared instance of the client, so in Swift 3 your code above should be
GMSPlacesClient.shared().currentPlace(callback: {
(placeLikelihoods, error) -> Void in
guard error == nil else {
print("Current Place error: \(error!.localizedDescription)")
return
}
})

Google Places API Autocomplete not working bad request

I'm trying to use Google places API to get autocomplete.
I've checked everything:
API keys are activated (disabled every restriction)
I'm calling GMSServices.provideAPIKey and GMSPlacesClient.provideAPIKey
Initializing the object placesClient = GMSPlacesClient.shared()
The call I'm making is:
let filter = GMSAutocompleteFilter()
filter.type = .establishment
placesClient?.autocompleteQuery(textField.text!, bounds: nil, filter: filter) { (predictionList, error) in
if let error = error {
print("Pick Place error: \(error.localizedDescription)")
return
}
if let list = predictionList{
self.resultList = list
}
}
The error I'm getting is:
Printing description of error: Error
Domain=com.google.places.ErrorDomain Code=-3 "An internal error
occurred in the Places API library. If you believe this error
represents a bug, please file a report using the instructions on our
community and support page
(https://developers.google.com/places/support)."
UserInfo={NSLocalizedFailureReason=An internal error occurred in the
Places API library. If you believe this error represents a bug, please
file a report using the instructions on our community and support page
(https://developers.google.com/places/support).,
NSUnderlyingError=0x608000445370 {Error
Domain=com.google.places.server.ErrorDomain Code=-1 "(null)"
UserInfo={NSUnderlyingError=0x60800024f030 {Error
Domain=com.google.GTLRErrorObjectDomain Code=400 "(Bad Request)"
UserInfo={error=Bad Request, GTLRStructuredError=GMSx_GTLRErrorObject
0x60800024f9f0: {message:"Bad Request" errors:[1] code:400},
NSLocalizedFailureReason=(Bad Request)}}}}}
Has anyone else seen this problem in Xcode 8 iOS 10? Thanks
EDIT: Now it seems that some requests are working... Maybe the server is having problems?

Resources