Login is still unavailable

I have already whitelisted my application to get user permission

I am using the same client key and client secret after this, but I am still running into:

**TW ERROR: Error Domain=TwitterAPIErrorDomain Code=37 "Your application may not have access to email addresses or the user may not have an email address. To request access, please visit https://support.twitter.com/forms/platform." UserInfo=0x7fa3cb9e0df0 {NSLocalizedDescription=Your application may not have access to email addresses or the user may not have an email address. To request access, please visit https://support.twitter.com/forms/platform.}

Here is my code:

let twitterInstance = Twitter.sharedInstance()
twitterInstance.startWithConsumerKey(TwitterClientKey, consumerSecret: TwitterClientSecret)

twitterInstance.logInWithCompletion {
    (session, error) -> Void in
    if (session != nil) {
        println("signed in as \(session.userName)");

        if (twitterInstance.session() != nil) {
            if let shareEmailViewController = TWTRShareEmailViewController(completion: {
                (email: String!, error: NSError!) in
                print("TW EMAIL: \(email)")
                if (email != nil) {
                    print("TW EMAIL: \(email)")
                } else {
                    print("TW ERROR: \(error)")
                }
            }) {
                self.presentViewController(shareEmailViewController, animated: true, completion: nil)
            }
        } else {
            print("User not logged in")
        }


    } else {
        println("error: \(error.localizedDescription)");
    }
}

      

+3


source to share


1 answer


To get the user's email address, your application must be whitelisted. Here is the link . Go to use this form . You can send mail to sdk-feedback@twitter.com

with some details about your application, for example, as a key "Consumer", "App Store" in the application, "Link to privacy policy", "Metadata", "Instructions for entering our application, etc. . ". They will respond within 2 to 3 business days.

Here's the story of how I got the whitelisted conversation with the Twitter support team:

  • Send an email to sdk-feedback@twitter.com

    with some details about your application, for example, in the section "Consumer Key", in the application "App Store", "Link to privacy policy", "Metadata", "Instructions for signing in to our application". Mention in the mail that you want to access the user's email address in your application.

  • They will review your application and respond to you within 2-3 business days.

  • Once they say your app is whitelisted, update your app preferences in the Twitter developer portal. Login to apps.twitter.com and:

    • In the Settings tab, add the URL for the Terms of Service and Privacy Policy
    • On the Permissions tab, change the scope of the token for the email request. This option will only appear after your app is whitelisted.


Get user's email address:

    -(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)
        }
    }

      

Hope this helps !!!

+2


source