how to get email of user from STTwitter

325 Views Asked by At

I have tried various third party tools like STTWitter to get user's profile like image, firstname, email, address, dob etc. I have been doing google since last 6 hours. but I am not able to get user's profile from twitter. I have referred lot of links on stackoverflow but I am not able to get result which I want.

Anyone can help me in this issue?

Any help would be appreciable.

Thanks in advance.

1

There are 1 best solutions below

0
On

Use TwitterKit will able to provide user email-id

You need to read full document ofRequest a User's Email Address

Requesting a user’s email address requires your application to be whitelisted by Twitter.The TWTRShareEmailViewController class presents a view to the user to request access to the email address associated with their Twitter account. It must be presented modally.

Here’s an example that shows how to use

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 {
  // TODO: Handle user not signed in (e.g.
  // attempt to log in or show an alert)
}