【问题标题】:Request Denied in Google Maps geocode API iOSGoogle Maps geocode API iOS 中的请求被拒绝
【发布时间】:2015-09-12 04:53:15
【问题描述】:

我正在尝试将谷歌地图集成到我的 iOS 应用程序中。我也创建并尝试了 iOS 密钥、服务器密钥和浏览器密钥。我重新生成了密钥,但仍然获得“访问被拒绝”的状态。我在这里看到了很多答案,但没有一个解决方案适合我。我收到以下回复

This API project is not authorized to use this API. Please ensure that this API is activated in the APIs Console

有时会这样

"error_message" : "This IP, site or mobile application is not authorized to use this API key. Request received from IP address xxx.xxx.xxx.xxx, with empty referer"

我尝试使用重新生成的密钥,得到以下结果。

"error_message" : "The provided API key is expired."

解决方案可能很简单,但我真的卡住了。任何帮助表示赞赏

【问题讨论】:

    标签: ios google-maps google-geocoding-api


    【解决方案1】:

    日志或错误已清除。

    要使用 google_maps,您必须:

    • 在Google Developer 中注册您的应用程序包

    • 获取 api 密钥(如果您在更新之前已获取) • 在 AppDelegate 中调用 google 初始化

    [GMSServices provideAPIKey:GOOGLE_MAP_SERVICE];
    

    【讨论】:

    • 我已经在谷歌开发者中注册了这个包并且已经在 AppDelegate 中调用了。当然,我忘记更新 AppDelegate 中的密钥了。但是,仍然出现错误消息
    • 请在您的 oroject 和谷歌开发人员中仔细检查您的 api 密钥和捆绑包 :) 只需检查一次即可在您的应用中调用
    • 都是一样的,没有任何错误。
    猜你喜欢
    • 2015-06-25
    • 2017-09-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-10-24
    • 1970-01-01
    • 2013-11-29
    相关资源
    最近更新 更多