Ios TwitterKit框架未获取电子邮件密钥
我使用的是Fabric的TwitterKit框架和2.8.0版。我已按照指示进行操作Ios TwitterKit框架未获取电子邮件密钥,ios,objective-c,twitter-fabric,twitterkit,Ios,Objective C,Twitter Fabric,Twitterkit,我使用的是Fabric的TwitterKit框架和2.8.0版。我已按照指示进行操作 并且已经检查了请求用户访问电子邮件地址的权限。但有时我根本没有收到“验证凭据”响应,有时在验证凭据API响应中也没有收到“电子邮件”键。使用Fabric登录Twitter。请使用下面的代码 - (IBAction)TwitteClickAction:(id)sender { [[Twitter sharedInstance] logInWithMethods:TWTRLoginMethodW
并且已经检查了请求用户访问电子邮件地址的权限。但有时我根本没有收到“验证凭据”响应,有时在验证凭据API响应中也没有收到“电子邮件”键。使用Fabric登录Twitter。请使用下面的代码
- (IBAction)TwitteClickAction:(id)sender
{
[[Twitter sharedInstance] logInWithMethods:TWTRLoginMethodWebBased completion:^(TWTRSession *session, NSError *error)
{
if (session)
{
NSLog(@"signed in as %@", [session userName]);
NSLog(@"signed id in as %@", [session userID]);
TWTRAPIClient *client = [TWTRAPIClient clientWithCurrentUser];
NSURLRequest *request = [client URLRequestWithMethod:@"GET"
URL:@"https://api.twitter.com/1.1/account/verify_credentials.json"
parameters:@{@"include_email": @"true", @"skip_status": @"true"}
error:nil];
[client sendTwitterRequest:request completion:^(NSURLResponse *response, NSData *data, NSError *connectionError)
{
if (data)
{
NSError *jsonError;
NSDictionary *json = [NSJSONSerialization JSONObjectWithData:data options:0 error:&jsonError];
NSLog(@"info is ====>%@",json);
}
else {
NSLog(@"Error: %@", connectionError);
}
}];
} else {
NSLog(@"error: %@", [error localizedDescription]);
}
}];
}
谢谢,我刚刚忘记提到基于web的方法。