This IP, site or mobile application is not authorized to use this API key. How to fix this issue for an ios app?
Asked Answered
A

2

5

I'm working on Augmented reality in ios app. I found a nice tutorial and a sample project from this site. While running that app in my device, I received the error in NSLOG console,

Response: {
"error_message" = "This IP, site or mobile application is not authorized to use this API key.";
"html_attributions" =     (
);
results =     (
);
status = "REQUEST_DENIED";
}

I'd created a new project in Google dev site and created Sever Key as iOS Key is not supported for Google places Api. I'd also tried with browser key, it didn't work.

My Request url is look like below,

<NSMutableURLRequest https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=12.974760,80.225061&radius=1000&key=AIzaXXXXXXXXXXXXXXXXXXXMQ&sensor=true>

Tried some solutions suggested here in SO, but no luck. Any suggestions will be appreciated.

Abdias answered 15/8, 2014 at 5:45 Comment(6)
You tried the browser key that you first get when creating an API account? This works for me...Also, are you sure that your API is active? As in, in the console the Google Places API is turned on?Claim
@BHendricks, sorry for late response. I just search about browser key. Isn't it created for each project in the API account? i can't understand ur point that "the browser key that you first get when creating an API account?"Abdias
What I mean is in your main console for your API account, you have a browser key. Have you tried that key? Main console - console.developers.google.comClaim
@BHendricks, If I goto console.developers.google.com, it redirects to console.developers.google.com/project. Where can I find that key? Please assist.Abdias
So you want to select your project your working on, then on the left hand side, click on "Credentials", there should be a box with the title "Key for browser applications"Claim
Possible duplicate of This IP, site or mobile application is not authorized to use this API keyRedeploy
A
15

The issue is with generating browser keys. while generating new browser key, we should not enter any website urls in the websites tab, instead of that directly clicking generate button could give a new browser key.

enter image description here

While using that key, the issue got fixed.

Abdias answered 16/8, 2014 at 6:31 Comment(5)
When using this method and likewise, choosing the Android button, I am confronted with "The provided API key is expired"Sphene
@NAZIK bro have u worked with quickblox api... i m facing some issueUnrelenting
@Sphene - Actually, I did too, but I waited about 5 minutes and it started working all of a sudden...weird.Buckskin
@d2burke, yeah weird. I got past it somehow because the app is working now. Not sure how I did though.Sphene
As an aside, in case anyone generated a key with any websites in the referrer list, the key may have to be regenerated with the list empty in order to get service to work from any server address.Comprise
T
0

Choose browser key only without any website name then it will work for android, I tried for both server key and android key but it is not working for me.

Tiger answered 1/4, 2016 at 10:34 Comment(2)
The question is about IOS, not android.Colby
I know, this is for ios but this is also working for me in android.Tiger

© 2022 - 2024 — McMap. All rights reserved.