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.

Community
  • 1
  • 1
Nazik
  • 8,696
  • 27
  • 77
  • 123
  • 1
    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? – BHendricks Aug 15 '14 at 05:46
  • @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?" – Nazik Aug 15 '14 at 06:07
  • 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.com – BHendricks Aug 15 '14 at 06:13
  • @BHendricks, If I goto https://console.developers.google.com, it redirects to https://console.developers.google.com/project. Where can I find that key? Please assist. – Nazik Aug 15 '14 at 06:18
  • 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" – BHendricks Aug 15 '14 at 06:19
  • Possible duplicate of [This IP, site or mobile application is not authorized to use this API key](https://stackoverflow.com/q/21933247/608639) – jww Nov 11 '18 at 02:09

2 Answers2

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.

Nazik
  • 8,696
  • 27
  • 77
  • 123
  • 1
    When using this method and likewise, choosing the Android button, I am confronted with "The provided API key is expired" – tricknology Sep 04 '14 at 05:20
  • @NAZIK bro have u worked with quickblox api... i m facing some issue – ChenSmile Oct 13 '14 at 10:55
  • 2
    @tricknology - Actually, I did too, but I waited about 5 minutes and it started working all of a sudden...weird. – d2burke Jan 29 '15 at 13:56
  • @d2burke, yeah weird. I got past it somehow because the app is working now. Not sure how I did though. – tricknology Jan 31 '15 at 00:00
  • 1
    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. – Tim Biegeleisen Mar 03 '16 at 14:46
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.