Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How would I get my App whitelisted on Twitter to get user email?

I am developing an iOS App and want to request a user to share his/her email address. I have used Twitter kit framework for authenticating user. That part of my App has been done successfully. Now, I want to request user email. I have referred to Twitter developers documentation telling me to visit a form to get information to get my App white-listed. In that form, I couldn’t found an option for requesting a user’s email.

So, I need some guidance for the process for achieving this. Twitter should have given a straight forward information about this.

like image 397
NSPratik Avatar asked Dec 14 '22 14:12

NSPratik


1 Answers

Finally, after having a long conversation with [email protected], I got my App whitelisted. Here is the story:

  • Send mail to [email protected] with some details about your App like Consumer key, App Store link of an App, Link to privacy policy, Metadata, Instructions on how to log into our App. Mention in mail that you want to access user email address inside your App.

  • They will review your App and reply to you within 2-3 business days.

  • Once they say that your App is whitelisted, update your App's settings in Twitter Developer portal. Sign in to apps.twitter.com and:

  1. On the 'Settings' tab, add a terms of service and privacy policy URL
  2. On the 'Permissions' tab, change your token's scope to request email. This option will only been seen, once your App gets whitelisted.

It's time to code:

-(void)requestUserEmail
{
    if ([[Twitter sharedInstance] session]) {
        
        TWTRShareEmailViewController *shareEmailViewController =
        [[TWTRShareEmailViewController alloc]
         initWithCompletion:^(NSString *email, NSError *error) {
             NSLog(@"Email %@ | Error: %@", email, error);
         }];
        
        [self presentViewController:shareEmailViewController
                           animated:YES
                         completion:nil];
    } else {
        // Handle user not signed in (e.g. attempt to log in or show an alert)
    }
}
like image 133
NSPratik Avatar answered May 02 '23 08:05

NSPratik