Read through all of the similar posts and couldn't find a solution.
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] } }
response :
{
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.";
};
}
I went to the Google Developers Console and explored the Custom Search API for my project. It corresponds to this URL:
https://console.developers.google.com/project/[PROJECT ID]/apiui/api/customsearch/method/search.cse.list
It successfully ran and showed this request (along with the correct results):
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
So I conclude from that success:
- [SEARCH_ENGINE_ID_FOR_CUSTOM_SEARCH_ENGINE] value is correct
- [SEARCH_ENGINE_ID_FOR_CUSTOM_SEARCH_ENGINE] value is associated to my project, since I "explored" it from within my project
I verified that the Custom Search API is indeed turned ON
I also verified on the API Access page, underneath that project, that I am using the correct API Key and iOS Apps (bundle ID) listed in the Simple API Access section.
I am not sure where to go from here to troubleshoot this and get it working.
Any help will be much appreciated!