Я интегрировал Google URL-Shorten API
в свое приложение для iOS только для тестирования. Идентификатор пакета моего приложения добавлен мной в список Authorized iOS Applications
для отправки запроса.
Но всякий раз, когда я отправляю запрос HTTP
POST
с помощью NSURLRequest
, я получаю в ответ следующую ошибку JSON
:
{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "accessNotConfigured",
"message": "Access Not Configured. The API is not enabled for your project, or there is a per-IP or per-Referer restriction configured on your API key and the request does not match these restrictions. Please use the Google Developers Console to update your configuration.",
"extendedHelp": "https://console.developers.google.com"
}
],
"code": 403,
"message": "Access Not Configured. The API is not enabled for your project, or there is a per-IP or per-Referer restriction configured on your API key and the request does not match these restrictions. Please use the Google Developers Console to update your configuration."
}
}
Я не могу понять, как это решить. Я сделал одно предположение: «Может быть, мне придется использовать API в онлайн-приложении».
Поддерживающая ссылка на мое предположение взята из документации по API.
If your application accesses APIs directly from iOS, you will need the application's Bundle ID and (optionally) its Apple App Store ID:
The application's Bundle ID is the bundle identifier as listed in the app's .plist file. For example: com.example.myapp.
The application's App Store ID is in the app's iTunes URL so long as the app was published in the Apple iTunes App Store. For example, in the app URL http://itunes.apple.com/us/app/google+/id447119634, the App Store ID is 447119634.