Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/113.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios TwitterKit框架未获取电子邮件密钥_Ios_Objective C_Twitter Fabric_Twitterkit - Fatal编程技术网

Ios TwitterKit框架未获取电子邮件密钥

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

我使用的是Fabric的TwitterKit框架和2.8.0版。我已按照指示进行操作
并且已经检查了请求用户访问电子邮件地址的权限。但有时我根本没有收到“验证凭据”响应,有时在验证凭据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的方法。