未配置 Google 日历 API 访问权限
我从这里下载了一个示例项目:http://code.google.com/p/google-api-java-client/source/browse/calendar-android-sample/?repo=samples
I've downloaded a sample project from here: http://code.google.com/p/google-api-java-client/source/browse/calendar-android-sample/?repo=samples
除了使用 Eclipse 的 Keytool 插件检索 SHA1 密钥之外,我执行了所有步骤.但是,当我在手机上运行该应用程序时,它会显示一条未配置访问权限的错误消息以下来自 LogCat:
I performed all the steps as described except that retrieved the SHA1 key using the Keytool plugin for Eclipse. When I run the app on my phone however, it shows an Access not configured error message The following is from the LogCat:
com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden
{
"code": 403,
"errors": [
{
"domain": "usageLimits",
"message": "Access Not Configured",
"reason": "accessNotConfigured"
}
],
"message": "Access Not Configured"
}
我在 google 控制台中创建了一个项目,启用了日历 API,创建了一个 OAuth2 客户端 ID,使用了来自 Eclipse 的 SHA1 密钥并且没有看到任何错误消息.但是,我在控制台中看不到客户端机密.您知道缺少什么吗?
I have created a project in google console, enabled the calendar APIs, created an OAuth2 Client ID, used the SHA1 key from Eclipse and have not seen any error maessages. I can't see a client secret in the console though. Do you have any idea what is missing?
这些是来自 Android Manifest 的权限,如果您想知道的话.
These are the permissions from the Android Manifest, in case you're wondering.
enter code here
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />
我是使用日历 API 的新手,希望在创建我自己的应用程序之前先看看这个应用程序是否有效.此外,我怀疑这在未来也可能成为一个问题.
I'm new to using the calendar APIs would like to see this app work before creating my own. Also, I suspect this might become an issue in the future as well.
需要使用客户端 API 执行访问配置.请参阅左栏中的链接.
Access Configuration needs to be performed using the Client API. See the links in the left column.
由于您在请求用户授权时必须指定范围,因此这项工作似乎是多余的.不过还是有必要的.http://www.tqis.com/eloquency/googlecalendar.htm
Since you have to specify scope when asking for user authorization, this effort seems redundant. But necessary nonetheless. http://www.tqis.com/eloquency/googlecalendar.htm