我使用https://maps.googleapis.com/maps/api/geocode/json?链接服务器密钥和用户IP以查找任何地址的纬度和经度,当我尝试我发现错误为
我有一个来自谷歌的服务器访问密钥,我已将我的服务器的IP地址放在他们的白名单中.
我试图通过PHP CURL访问的URL是:
结果我得到:
Array ([error_message] => This IP, site or mobile application is not authorized to use this API key. [results] => Array ( ) [status] => REQUEST_DENIED)
Run Code Online (Sandbox Code Playgroud)
有什么我需要配置.地理编码api也已打开.
我正在开发ios应用程序中的增强现实.我从这个网站找到了一个很好的教程和一个示例项目.在我的设备中运行该应用程序时,我在NSLOG控制台中收到错误,
Response: {
"error_message" = "This IP, site or mobile application is not authorized to use this API key.";
"html_attributions" = (
);
results = (
);
status = "REQUEST_DENIED";
}
Run Code Online (Sandbox Code Playgroud)
我在Google开发者网站上创建了一个新项目 并创建了Sever Key,因为Google地方Api 不支持iOS Key.我也尝试过使用浏览器密钥,但它没有用.
我的请求网址如下所示,
<NSMutableURLRequest https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=12.974760,80.225061&radius=1000&key=AIzaXXXXXXXXXXXXXXXXXXXMQ&sensor=true>
Run Code Online (Sandbox Code Playgroud)