Google API 域 iOS 具有访问令牌

Google Domain API for iOS with access token

我正在开发一个带有 Google 域 API 的应用程序,它将管理活动。我有一些问题:

1) 此应用程序适用于 iOS,但我没有看到 GoogleClientBuilder 对 Google frameworks/PODs 的任何引用。不支持iOS吗?

2) 我能够通过 Google 通过 "GIDSignInButton" 登录并委托,并获得访问令牌和刷新令牌。

但是 API 用于在 Google 域

中撰写帖子

https://www.googleapis.com/plusDomains/v1/people/userId/activities

在 header 中没有 "access token" 参数,但它需要范围授权。在'GIDSignInButton'中,没有指定作用域的选项。

我已经提到了 https://developers.google.com/+/domains/ ,提到的 JAVA 代码根本没有用。

如果我能在这方面得到一些指导,我将不胜感激。

您可以使用 two-way 通过 Google 验证用户并实现任何其他 Google API 服务。

1.Using Google API-Objective C 客户端,在 GitHub.

上可用

使用此方法,您可以实现登录,它有几个示例代码,例如 Google +、Blogger API 集成。

2 使用 Google Sign-In for iOS,这是基于框架的实现。

在此方法中,您需要对用户进行身份验证,一旦用户通过身份验证,您就可以将访问令牌作为请求添加到每个请求中header。

 curl -i -H "Accept: application/json" -H "Authorization: Bearer {{ACCESS_TOKEN}}" "https://www.googleapis.com/plusDomains/v1/people/me/activities/user"  

请确保您拥有正确的权限,在登录过程中才能获取API期间的任何数据。