2014-01-28 52 views
0

oauth使用FHSTwitterEngine登录Twitter。我想从twitter帐号中获取性别,电子邮件,用户名,生日。现在,我只有用户名。如何使用FHSTwitterEngine登录Twitter用户的详细信息

+0

显示您的错误日志或您尝试过什么? – Mani

+1

没有错误日志 '的UIViewController *的LoginController = [[FHSTwitterEngine sharedEngine] loginControllerWithCompletionHandler:^(BOOL成功){ 的NSLog(@ “FHSTwitterEngine.sharedEngine.authenticatedUsername%@”,FHSTwitterEngine.sharedEngine.authenticatedUsername); NSLog(@“FHSTwitterEngine.sharedEngine.authenticatedID%@”,FHSTwitterEngine.sharedEngine.authenticatedID); }]; [self presentViewController:loginController animated:YES completion:nil];' – user3164056

+0

FHSTwitterEngine是否声称能够检索性别,电子邮件和生日?据我所知,Twitter没有API来检索任何这些。查看API文档以查看是否可以找到某些内容:https://dev.twitter.com/docs/api/1.1 – skladek

回答

1

Twitter API不允许获取用户电子邮件ID(受保护)。除此之外,您可以通过采纳以下片段获取所有的细节,只要登录

[[FHSTwitterEngine sharedEngine] permanentlySetConsumerKey:twitterAPIKey 
                andSecret:twitterAPISecret]; 
[[FHSTwitterEngine sharedEngine] setDelegate:_signInVW]; 
[[FHSTwitterEngine sharedEngine] loadAccessToken]; 

//PASS YOUR TWITTER ID, TWITTER OAUTH TOKEN STR, TWITTER OAUTH TOKEN SECREAT STR 

NSArray *timeLineAry = [[FHSTwitterEngine sharedEngine] getTimelineForUser:   [[FHSTwitterEngine sharedEngine] authenticatedID] isID:YES count:1]; 
twitterID = [[FHSTwitterEngine sharedEngine] authenticatedID]; 
twitterOauthTokenStr = [[FHSTwitterEngine sharedEngine] accessToken].key; 
twitterOauthTokenSecretStr = [[FHSTwitterEngine sharedEngine] accessToken].secret; 

if (timeLineAry.count > 0) { 
} 

使用

//获取验证ID timelinearray获取用户屏幕名称和发布数据的服务,最后你会得到用户信息。

相关问题