Email id is coming null from twitter api sdk in android "com.twitter.sdk.android:twitter:1.13.1@aar"

900 views Asked by At

I am following this tutorial. I need the email id of the user. The result of my code is zero.

 TwitterAuthClient authClient = new TwitterAuthClient();
        authClient.requestEmail(session, new Callback<String>() {
            @Override
            public void success(Result<String> result) {
                // Do something with the result, which provides the email address
                Log.d(TAG,"result = "+result);
            }

            @Override
            public void failure(TwitterException exception) {
                // Do something on failure
                Log.d(TAG,"exception = "+exception);
            }
        });

official documentation

2

There are 2 answers

2
Swapnil On

Your twitter application needs to be white listed from twitter.

0
Shubham AgaRwal On

please make sure you have following additional permission enabled in your Twitter app setting enter image description here