【问题标题】:Google Custom search API returning Access Not Configured (iOS app)Google 自定义搜索 API 返回访问未配置(iOS 应用)
【发布时间】:2014-05-05 01:11:26
【问题描述】:

阅读所有类似的帖子,但找不到解决方案。

NSURLConnection:

<NSURLConnection: 0x178004020> { request: <NSURLRequest: 0x178003ff0> { URL: https://www.googleapis.com/customsearch/v1?key=[API_KEY_SPECIFIC_TO_IOS_BUNDLE_ID]&cx=[SEARCH_ENGINE_ID_FOR_CUSTOM_SEARCH_ENGINE]&q=[SEARCH_STRING] } }

回复:

{
    error =     {
        code = 403;
        errors =         (
                        {
                domain = usageLimits;
                message = "Access Not Configured. Please use Google Developers Console to activate the API for your project.";
                reason = accessNotConfigured;
            }
        );
        message = "Access Not Configured. Please use Google Developers Console to activate the API for your project.";
    };
}

我访问了 Google Developers Console,并为我的项目探索了自定义搜索 API。对应这个网址:

https://console.developers.google.com/project/[PROJECT ID]/apiui/api/customsearch/method/search.cse.list

它成功运行并显示了这个请求(连同正确的结果):

GET https://www.googleapis.com/customsearch/v1?q=[SEARCH_STRING]&cx=[SEARCH_ENGINE_ID_FOR_CUSTOM_SEARCH_ENGINE]&key={YOUR_API_KEY}

X-JavaScript-User-Agent:  Google APIs Explorer

所以我从这个成功中得出结论:

  1. [SEARCH_ENGINE_ID_FOR_CUSTOM_SEARCH_ENGINE] 值正确
  2. [SEARCH_ENGINE_ID_FOR_CUSTOM_SEARCH_ENGINE] 值与我的项目相关联,因为我从我的项目中“探索”了它

我确认自定义搜索 API 确实已开启

我还在该项目下方的 API 访问页面上验证了我正在使用简单 API 访问部分中列出的正确 API 密钥和 iOS 应用程序(捆绑 ID)。

我不确定从这里去哪里解决这个问题并让它正常工作。

任何帮助将不胜感激!

【问题讨论】:

标签: ios objective-c google-api google-custom-search


【解决方案1】:

仔细检查您的 Google Developers 控制台是否显示为以下屏幕(对于您自己的模块,我的是谷歌地图)。

如果您确定开发者控制台端的一切都正确,但您仍然看到错误,请从控制台中删除它并创建一个新的,然后重试。是的,这很奇怪,但在此之前我也遇到过类似的问题,我通过 delete and recreate 解决了这个问题。

【讨论】:

  • 嗨瑞奇。感谢您的帮助。我删除了凭据,仍然没有爱。我会尝试通过电子邮件发送您提供的联系人。我会报告我的发现。
  • 没问题。我希望 Brett 能够进一步帮助你。
  • 没有回音。感谢您的勇敢尝试!
  • 没问题。我希望你能以某种方式找到让它工作的方法。或许你可以试试像groups.google.com/forum/#!forum/google-ajax-search-api这样的Google Group,看看你有没有运气。
猜你喜欢
  • 2012-12-30
  • 1970-01-01
  • 1970-01-01
  • 2015-01-18
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-04-27
相关资源
最近更新 更多