原谅我的英语!
我正在使用 google Rest API 客户端和 GIDSignIn 为我的应用程序登录 google 帐户。
GIDSignIn.sharedInstance().delegate = self
GIDSignIn.sharedInstance().uiDelegate = self
GIDSignIn.sharedInstance().scopes = scopes
GIDSignIn.sharedInstance().signIn()
func sign(_ signIn: GIDSignIn!, didSignInFor user: GIDGoogleUser!,
withError error: Error!) {
if let error = error {
showAlert(title: "Authentication Error", message: error.localizedDescription)
self.service.authorizer = nil
} else {
self.service.authorizer = user.authentication.fetcherAuthorizer()
print("Successs")
}
}
使用后成功登录。
但我想在我的应用程序中使用 idToken 和 accessToken 从我的托管服务器获取。
通过使用这些令牌,我想获取谷歌日历事件。
请帮助我如何使用从我的托管服务器获取到我的 iOS 应用程序的令牌。
谢谢。