Google Places API: “This IP, site, or mobile application is not authorized to use this API key” - google-maps

I am testing the Google Places API on the Flutter Android app.
When I send a request to the API I get a JSON result with the following error message:
This IP, site or mobile application is not authorized to use this API key.
To build the request, I went to the Google API console and generated my Android API Key based on my application package.
I'm using Google Maps on the app and trying to make a request to the Places API.
I put both Application restrictions and API restrictions in Google API console using package name and SHA1
Without restrictions Places API work but with restrictions it's not working.

Related

Google Maps API not authorized from Flutter app

I'm fairly new to all this so any help is gratefully received. I have a flutter app that calls the Google Maps API. To call the API I pass it my Google API key and in order to try and make it secure I have set up application restrictions in https://console.cloud.google.com/
The problem is that now when I call the Maps API I get the follwoing error:-
This IP, site or mobile application is not authorized to use this API key
Below is a screenshot of the settings that I have applied. What have I done wrong?
UPDATE: Some more information
The relevant APIs are enabled. The SHA-1 Fingerprint is correct. My app is running in debug mode, the certificate is the debug one. If I unrestrict the API key then everything runs okay.

The Google Maps API fails me

I have created a website and Google Maps is failing me to locate the company.
I have generated a KEY API in the Google console and I have introduced it in WordPress through the "Google maps API Key" plugin.
The case is that the map is seen for 1 second, but then it stops showing and the following error message appears: "An error has occurred, this page has not loaded Google Maps correctly." Discover the technical details of the problem in the javascript console ".
The web in question is: https://arsaiguarderia.com/
The map is on the home screen at the bottom and on the contact screen.
I see this:
js?key=A.....Y&ver=3.4:50 Google Maps JavaScript API error: RefererNotAllowedMapError
https://developers.google.com/maps/documentation/javascript/error-messages#referer-not-allowed-map-error
Your site URL to be authorized: https://arsaiguarderia.com/
Maybe you need to go to your Google Cloud Platform > API project > API > Credentials > API key name. Then set the HTTP referrers restriction to your web site name.
Looks like its a problem of http referers according to the javascript console, could you make sure your site is not blocked in the google console? Edit your api key and look for application restrictions

Restricted Google API key is not working in Reverse Geocoding

I have develop an iPhone Application that have Google Api https://maps.googleapis.com/maps/api/geocode/json?latlng=%f,%f&key=API_KEY
if I have use Public apikey then its working fine but when I generate ristricted api key from google concole then api is not working and give error
{
"error_message" : "This IP, site or mobile application is not authorized to use this API key. Request received from IP address 27.109.**.**, with empty referer",
"results" : [],
"status" : "REQUEST_DENIED"
}
I have added valid bundle Id when I generate restricted Api key.
please give me solution Thanks in advance.
You are calling a web service (Geocoding API). Please note that web services support only IP address restriction. The iOS app restriction is not valid for web services, it works only with Google Maps SDK for iOS. You can find information about restrictions supported by each API in this document:
https://developers.google.com/maps/faq#keysystem
In order to use a restricted API key with Geocoding API from iOS app you will need to create your own intermediate server and execute calls to Google from your server. In this case you can protect an API key with IP address of your server. The app will request information from your server and you server will call Google and pass back results.

Google Maps API for Work and phonegap / cordova

I bought an API key for Google Map. I tried to implement the client key in a PhoneGap application.
<script src="http://maps.googleapis.com/maps/api/js?client=YOUR_CLIENT_ID&v=3.17"></script>
However, it doesn't work. I have an alert with the message: "your domain is not permitted."
I can't put a domain in the admin console, because it's a phonegap app and the file protocol doesn't work well too.
How can I use the client key with a phonegap app ?
Many thanks
I think Google Maps Javascript API v3 for work does not work on PhoneGap/Cordova, because the API refers the domain of the page.
You can still use Google Maps Web APIs (direction APIs, geocoding APIs ... etc) with your key.
Ask your Google Maps reseller (or directly Google support team).

Google does not permit the use of the Maps API for this application

Good day.
Now i create api Key for browser apps (with referers).
Referers: *.invait.ru/*
But on site i get error:
Google does not permit the use of the Maps API for this application.
API Google key provided is invalid or do not have permission to use it
with Google Maps JavaScript API v3 on this site.
Screenshot:
Tell me please why i get it error and how remove error and use google map api v3?
For domain use Referers: invait.ru/*