0

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

4

1 回答 1

1

Twitter API 不允许获取用户电子邮件 ID(受保护)。除此之外,您可以使用以下代码段获取所有详细信息,

//仅在登录时获取身份验证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) {
}

使用时间线数组获取用户屏幕名称并将数据发布到服务,最后您将获得用户信息。

于 2014-12-23T06:58:15.213 回答