This IP, site or mobile application is not authorized to use this API key - Android
Asked Answered
P

7

8

I have a problem with connection with Google maps API V2 and Android. I' ve enabled services:

  • Google Maps Android API v2
  • Places API

Also I've added sha1 fingerprint.

enter image description here

But I still get this message: This IP, site or mobile application is not authorized to use this API key

I'm calling service from Android. Do you know where might be the problem, cause I don't know where to search.

Photoengraving answered 29/5, 2014 at 16:56 Comment(3)
I am facing the same issue. Did u fix this?Hillard
For android application you need to use a Browser key not the Android key.Blume
Possible duplicate of This IP, site or mobile application is not authorized to use this API keyOsullivan
I
9

You must be creating a browser key instead of an android key. I faced similar problem when I accidentely created an android key for Google Cloud Messaging instead of a server key. Please check which key is required for your purpose. For google maps v2 you need android key and for google places api you need a server key(searched google but not so sure on this one never used it). So basically you need two keys.

Update: You need server key for places api.

Irregular answered 29/5, 2014 at 17:3 Comment(3)
So then one API key is in manifest and one is in the request URL?Photoengraving
for maps its in the meta of manifest for places it may be in the url or your own server not sure about places api though. For gcm it was in my server.Irregular
But the doc says use the api key?Untried
B
6

Refer this tutorial.

http://www.androidhive.info/2012/08/android-working-with-google-places-and-maps-tutorial/

Step 1- Go to code.google.com/apis/console/?noredirect

Step 2- Create a new project

Step 3- Go to services and choose Places API, turn it on. This will ask your organization name and url.Fill them and click Ok.

Step 4- Now go to API Access and there will be your API Key. You don't have to click on Create new key. This will be your browser apps key which you can use in your Android Apps.

This solution worked for me perfectly.

Bomke answered 30/9, 2014 at 6:40 Comment(0)
S
2

If generating an Android App, the "Server" IP address could be any IP of any phone on any network. What do I write in the "Accept requests from these server IP addresses" box in order to have any IP address accepted?

Edit - Apologies. Apparently just leave it blank...

Stylopodium answered 6/8, 2014 at 0:35 Comment(0)
O
2

I just had this issue the other day, it is not actually an issue with this library.

First, make sure you're using a server API key, not an Android/iOS key (if you're doing mobile development). See this stackoverflow post: Google Places API request denied for Android autocomplete, even with the right api key . The TL;DR version of that link is that Google Places API doesn't support the Android/iOS key option, only the server option.

Second, and this goes without saying, make sure you're passing the key to the GooglePlaces instance.

Lastly, if you're restricting use of the API key by IP make sure your request is coming from an allowed address.

Onomatology answered 27/10, 2015 at 7:23 Comment(0)
C
0

You don't need to create a key for using Google place API, instead just use "Key for browser apps (with referers)". But if you want to use Google Map API, you need to generate a Android Key, and you could find instruction here :https://developers.google.com/maps/documentation/android/start.

Good luck.

Copaiba answered 4/11, 2014 at 21:19 Comment(0)
I
0

I got this problem too. but I SOLVED this issue only using something tricky. Go to your google console and create new key which is browser key, then let the column empty and save. you can use the key that has been created in you mobile apps now. GOOD LUCK! *Unfortunately I can't post an image to this answer

Indigent answered 17/4, 2015 at 9:37 Comment(0)
O
-3

Change your API key, you may use Android key in the URL. For to specify Key in the URL you need to get WEBSERVICE key.

Onomatology answered 22/12, 2015 at 5:28 Comment(2)
This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post - you can always comment on your own posts, and once you have sufficient reputation you will be able to comment on any post. - From ReviewFeune
I am also faced same situation ,While you are checking for places through forming a Webservice url maps.googleapis.com/maps/api/place/nearbysearch/… .... like Please use webservice API Key for maps.Onomatology

© 2022 - 2024 — McMap. All rights reserved.