2016-04-26 120 views
-3

请问您可以告诉我从twitter集成中获取电子邮件地址的过程是什么?我通过面料做到了。为了获得电子邮件地址,我遵循在https://support.twitter.com/forms/platform给出的所有说明。并从Twitter获取电子邮件。 你能帮我进一步处理吗? 我遵循此代码。关于未从twitter集成中获取电子邮件地址

[[Twitter sharedInstance] logInWithCompletion:^(TWTRSession *session, NSError *error) { 
     if (session) { 
      NSLog(@"signed in as %@", [session userName]); 
      NSLog(@"signed in as %@", [session userID]); 
      [self usersShow:[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) { 
       NSLog(@"tMail%@",response); 
      }]; 


     } else { 
      NSLog(@"error: %@", [error localizedDescription]); 
     } 
    }]; 

我得到这样的响应:

  { 
"contributors_enabled" = 0; 
"created_at" = "Wed Nov 30 11:39:55 +0000 2011"; 
"default_profile" = 1; 
"default_profile_image" = 0; 
description = "Software developer"; 
entities =  { 
    description =   { 
     urls =    (
     ); 
    }; 
}; 
"favourites_count" = 2; 
"follow_request_sent" = 0; 
"followers_count" = 6; 
following = 0; 
"friends_count" = 12; 
"geo_enabled" = 0; 
"has_extended_profile" = 0; 
id = 424967484; 
"id_str" = 424967484; 
"is_translation_enabled" = 0; 
"is_translator" = 0; 
lang = en; 
"listed_count" = 0; 
location = "Nokha, Rajasthan"; 
name = "Muraree pareek"; 
notifications = 0; 
"profile_background_color" = C0DEED; 
"profile_background_image_url" = "http://abs.twimg.com/images/themes/theme1/bg.png"; 
"profile_background_image_url_https" = "https://abs.twimg.com/images/themes/theme1/bg.png"; 
"profile_background_tile" = 0; 
"profile_banner_url" = "https://pbs.twimg.com/profile_banners/424967484/1432039697"; 
"profile_image_url" = "http://pbs.twimg.com/profile_images/1667595088/Image0236_normal.jpg"; 
"profile_image_url_https" = "https://pbs.twimg.com/profile_images/1667595088/Image0236_normal.jpg"; 
"profile_link_color" = 0084B4; 
"profile_sidebar_border_color" = C0DEED; 
"profile_sidebar_fill_color" = DDEEF6; 
"profile_text_color" = 333333; 
"profile_use_background_image" = 1; 
protected = 0; 
"screen_name" = Murareepareek; 
"statuses_count" = 3; 
"time_zone" = "New Delhi"; 
url = "<null>"; 
"utc_offset" = 19800; 
verified = 0; 
} 
+0

U可以显示乌尔试图代码 –

+0

我编辑的问题 –

+0

发布您的代码,你整合 – PSS

回答

2

I think you probably swept your eyes across this a bit too quick

1)通过您的开发者帐户,你必须提交请求Twitter的“白名单”您的应用程序,让您可以检索特定人的电子邮件。这是一种安全检查,因为美国的用户数据历史记录会非法出售给第三方,因此Twitter可以保护其用户免受强制广告,垃圾邮件和任何可能导致用户恼火的电子邮件地址的可能性。

https://dev.twitter.com/rest/reference/get/account/verify_credentials272 

“请求用户的电子邮件地址,需要您的应用程序由Twitter列入白名单。要请求访问,请使用此表。” 形式:https://support.twitter.com/forms/platform394

This form will get your app whitelisted based on a reply within 1-2 hrs or days depending on Twitter!

希望这可以帮助你!

相关问题