简体   繁体   中英

how to get email of user from STTwitter

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.

Use TwitterKit will able to provide user email-id

You need to read full document of Request 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)
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM