2017-02-15 3 views
0

私はFabricとバージョン2.8.0でTwitterKitフレームワークを使用しています。私は以下の指示に従っていますhttps://docs.fabric.io/apple/twitter/log-in-with-twitter.html#request-user-email-address そして、ユーザーからの電子メールアドレスアクセスを要求する許可は既にチェックされています。しかし、私はいつも "verify_credentials"レスポンスを得ていませんし、時にはverify_credentials APIレスポンスに "email"キーが得られないこともあります。TwitterKitフレームワークがメールキーを取得していません

答えて

0

ファブリックを使用してログインします。以下のコードを使用してください

- (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]); 
    } 
    }];  
    } 
+0

ありがとうございました。私は、Webベースのアプローチについて言及することを忘れていました。 –

関連する問題