问题描述
我已经使用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检索用户电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!