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

I am working on Augmented Reality in an ios app. I found a good tutorial and sample project for this site . While running this application on my device, I received an error in the 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 created a new project in the Google dev site and created the Sever Key as iOS Key is not supported for Google Api sites. I also tried using the browser key, this did not work.

My request url looks below

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

Tried several solutions suggested here at SO but no luck. Any suggestions would be appreciated.

+5
source share
2 answers

The problem is generating browser keys. when generating a new browser key, we should not enter the website URLs on the websites tab, instead of directly clicking the generate button could give a new browser key.

enter image description here

Using this key resolved the issue.

+15
source

Select a browser key only without a website name, then it will work for Android. I tried both the server key and the Android key, but it does not work for me.

0
source

Source: https://habr.com/ru/post/1200381/


All Articles