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

烈酒焚心 提交于 2019-12-09 18:31:33

问题


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.


回答1:


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.

While using that key, the issue got fixed.




回答2:


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.



来源:https://stackoverflow.com/questions/25321763/this-ip-site-or-mobile-application-is-not-authorized-to-use-this-api-key-how-t

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!