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

Nazik picture Nazik · Aug 15, 2014 · Viewed 14.9k times · Source

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.

Answer

Nazik picture Nazik · Aug 16, 2014

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.