Closed panchalAlpit closed 3 years ago
This is due to invalid apiKey
. The code only checks if there is an error http code, but the Google Maps API returns 200 with "error_message" key in response. You should open the Network DevTool and check the response from google maps.
Google maps Error messages.
Btw. this should be improved. Current implementation is just hiding the errors from google maps.
@Buk1m Thanks for the response. I have used the valid API key but right now I have using the free google account(without billing), so we need to purchase to google account(plan) or not. and also I have not to use the restriction API key.
Error:-
http: {error_message: This IP, site or mobile application is not authorized to use this API key. Request received from IP address xxxx:xxxx:xxx:xxxx:xxxx:xxxx:xxxx:xxxx, with empty referer, predictions: [], status: REQUEST_DENIED}
I have found the solution. Please update the below URL because of this is not the correct format.
final url = Uri.parse(
"https://maps.googleapis.com/maps/api/place/details/json?key=${widget.apiKey}&" +
"language=${widget.localizationItem!.languageCode}&" +
"placeid=$placeId");
to
var endpoint =
"https://maps.googleapis.com/maps/api/place/autocomplete/json?"
"&language=en_us&"
"input=mumbai&key=${widget.apiKey}";
[solution](https://stackoverflow.com/questions/21933247/this-ip-site-or-mobile-application-is-not-authorized-to-use-this-api-key/24235630#24235630)
I have to Enable the google place API but also not get the result