Google Maps API not authorized from Flutter app - google-maps

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.

Related

I'm trying to restrict an API key to Google Drive API, but it's behaving like I've set a referrer restriction

In the Google Developers Console, I have restricted my API key to only accept the Google Drive API calls. I don't use any HTTP referrers that might restrict calls to specific websites.
However, I constantly get error 403 with the ipRefererBlocked reason:
Here is an example of a request I'm trying to perform:
Interestingly, I face this issue only with the Google Drive API (with every single key I create). Other APIs (if I restrict an API key to them), like Google Sheets API, Google Calendar API, work perfectly fine.
If there are no restrictions (neither application restrictions nor API ones), everything works fine.
What am I doing wrong? Does anybody else face the same issue?

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

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.

Which Google Maps API to enable to get http get to work

I want to use this get in order to get Lat/Long for an address.
Currently, it always returns REQUEST_DENIED. This API project is not authorized to use this API.
I have ensured that my key is enabled, and currently, it has no restrictions for testing purposes. This is the url, with the actual key replaced with 12345.
https://maps.googleapis.com/maps/api/geocode/xml?address=123%2C%20Harbor%2C%20Woods%20Circle%2C%20Safety%2C%20Harbor%2C%20FLCA%2C%2034695&key=12345
I have tried Disabling the Google Maps API, and then Enabling it again, but I still get the same error message.
I am thinking that maybe I don't have the right API enabled on this, as it should be working.
To use the Geocoding Web Service you need to enable it in the Google API Console
I just found it, I needed to enable the Geocoding API.

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 cannot retrieve UI

I am trying to build a google maps app. The app runs but I am unable to retrieve the map UI.
Logs shows :Authorization failure. Please see https://developers.google.com/maps/documentation/android-api/start for how to correctly set up the map.
06-16 22:45:50.480 13860-14718/com.mapsapi.vatsan.googlemapsapidemo E/Google Maps Android API: In the Google Developer Console (https://console.developers.google.com)
Ensure that the "Google Maps Android API v2" is enabled.
Ensure that the following Android Key exists:
API Key: **************************************
Android Application (;): 24:85:5A:C0:F8:0D:36:4C:1A:B9:45:B6:21:92:B0:6E:7D:71:55:08;com.mapsapi.vatsan.googlemapsapidemo
I have used the correct API Key.
What exactly i have to do?
I know there are diferent keys for debug and released apps.
i recomend API v3 too.
Try this to register your api key.
https://console.developers.google.com/flows/enableapi?apiid=maps_android_backend&keyType=CLIENT_SIDE_ANDROID&r=24:85:5A:C0:F8:0D:36:4C:1A:B9:45:B6:21:92:B0:6E:7D:71:55:08%3Bcom.mapsapi.vatsan.googlemapsapidemo
It can take some minutes. Then you have to set your google_maps_key in your android app Manifiest.
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSDSSDDDAAD...Your API KEY" />
If doesnt work and if you are using android studio, try creating a new Map Activity(It's V3), complete res/values/google_maps_api.xml with the key and the map gonna work.
How to create google map