使用GTM OAuth2 for iOS检索用户电子邮件 [英] Retrieve User email using GTM OAuth2 for iOS

查看:101
本文介绍了使用GTM OAuth2 for iOS检索用户电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用GTM OAuth 2库成功实现了身份验证。但现在我想拥有用户的电子邮件ID。我应该如何继续。我知道我必须在这里调用一些东西: - $ / $>

$ $ p $ - (void)viewController:(GTMOAuth2ViewControllerTouch *)viewController
finishedWithAuth:(GTMOAuth2Authentication *)auth
错误:(NSError *)错误{
if(error!= nil){

NSLog(@SIGN IN ERROR:%@ ,error.description);
//认证失败
}其他{
//认证成功
}

}

解决方案

使用gtm-oauth2登录Google服务时,用户的电子邮件地址可用在auth对象的 userEmail 属性中登录后。


I have successfully implemented authentication using GTM OAuth 2 library. But now I want to have the email id of the user. How should I proceed. I know I have to call something in here :-

- (void)viewController:(GTMOAuth2ViewControllerTouch *)viewController
  finishedWithAuth:(GTMOAuth2Authentication *)auth
             error:(NSError *)error {
if (error != nil) {

    NSLog(@"SIGN IN ERROR : %@", error.description);
    // Authentication failed
} else {
    // Authentication succeeded
}

}

解决方案

When signing in to Google services with gtm-oauth2, the user's email address is available after sign-in in the auth object's userEmail property.

这篇关于使用GTM OAuth2 for iOS检索用户电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆