关于无法从 twitter 集成中获取电子邮件地址

Posted

技术标签:

【中文标题】关于无法从 twitter 集成中获取电子邮件地址【英文标题】:About not getting email address from twitter integration 【发布时间】:2016-08-19 19:43:57 【问题描述】:

你能告诉我从 twitter 集成中获取电子邮件地址的过程是什么吗?我是通过织物做的。为了获取电子邮件地址,我遵循了https://support.twitter.com/forms/platform 给出的所有说明。并且还从 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;

【问题讨论】:

你能展示你尝试过的代码吗 发布您集成的代码 我用代码更新了这个问题 @lalitasaini clientWithCurrentUser 遇到问题。这是什么请指导,我需要为此导入一些课程还是其他的请指导。 【参考方案1】:

1) 通过您的开发者帐户,您必须向 Twitter 提交请求以将您的应用“列入白名单”,以便您可以检索特定人员的电子邮件。这是一种安全检查,因为在美国的用户数据被非法出售给第三方的历史,例如,因此 Twitter 保护其用户免受强制广告、垃圾邮件和任何可能惹恼用户的电子邮件地址的影响。

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

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

希望对您有所帮助!

【讨论】:

以上是关于关于无法从 twitter 集成中获取电子邮件地址的主要内容,如果未能解决你的问题,请参考以下文章

如何在 iOS 中通过 Twitter API 获取用户电子邮件地址?

Facebook、Twitter 等。登录网站未获取电子邮件

在 iOS 中从 Twitter 获取用户个人资料详细信息(尤其是电子邮件地址)

将 FirebaseUI 与 Twitter 登录一起使用(iOS 应用)

我们可以从 Twitter oauth API 获取电子邮件 ID 吗?

从 Twitter 请求用户的电子邮件