Twitter login failed in Android 6.0 preview devices. Its working fine on all other devices.
Below code is used to initialize fabric with twitter.
TWITTER_ KEY and TWITTER_SECRET keys were obtained from twitter app settings.
TwitterAuthConfig authConfig = new TwitterAuthConfig(TWITTER_KEY, TWITTER_SECRET);
Fabric.with(this, new Twitter(authConfig));
Here is the error log i got during login using TwitterApiClient.
08-31 07:52:09.988 4692-4692/? E/Twitter: Failed to get request token
08-31 07:52:09.988 4692-4692/? E/Twitter: com.twitter.sdk.android.core.TwitterApiException: 401 Authorization Required
08-31 07:52:09.988 4692-4692/? E/Twitter: at retrofit.RestAdapter$RestHandler.invokeRequest(RestAdapter.java:383)
08-31 07:52:09.988 4692-4692/? E/Twitter: at retrofit.RestAdapter$RestHandler.access$100(RestAdapter.java:220)
08-31 07:52:09.988 4692-4692/? E/Twitter: at retrofit.RestAdapter$RestHandler$2.obtainResponse(RestAdapter.java:278)
08-31 07:52:09.988 4692-4692/? E/Twitter: at retrofit.CallbackRunnable.run(CallbackRunnable.java:42)
08-31 07:52:09.988 4692-4692/? E/Twitter: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
08-31 07:52:09.988 4692-4692/? E/Twitter: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
08-31 07:52:09.988 4692-4692/? E/Twitter: at retrofit.Platform$Android$2$1.run(Platform.java:142)
08-31 07:52:09.988 4692-4692/? E/Twitter: at java.lang.Thread.run(Thread.java:818)
08-31 07:52:10.000 4692-4692/? E/Twitter: Authorization completed with an error
08-31 07:52:10.000 4692-4692/? E/Twitter: com.twitter.sdk.android.core.TwitterAuthException: Failed to get request token
08-31 07:52:10.000 4692-4692/? E/Twitter: at com.twitter.sdk.android.core.identity.OAuthController$1.failure(OAuthController.java:95)
08-31 07:52:10.000 4692-4692/? E/Twitter: at com.twitter.sdk.android.core.internal.oauth.OAuth1aService$1.failure(OAuth1aService.java:215)
08-31 07:52:10.000 4692-4692/? E/Twitter: at com.twitter.sdk.android.core.Callback.failure(Callback.java:45)
08-31 07:52:10.000 4692-4692/? E/Twitter: at retrofit.CallbackRunnable$2.run(CallbackRunnable.java:53)
08-31 07:52:10.000 4692-4692/? E/Twitter: at android.os.Handler.handleCallback(Handler.java:739)
08-31 07:52:10.000 4692-4692/? E/Twitter: at android.os.Handler.dispatchMessage(Handler.java:95)
08-31 07:52:10.000 4692-4692/? E/Twitter: at android.os.Looper.loop(Looper.java:148)
08-31 07:52:10.000 4692-4692/? E/Twitter: at android.app.ActivityThread.main(ActivityThread.java:5417)
08-31 07:52:10.000 4692-4692/? E/Twitter: at java.lang.reflect.Method.invoke(Native Method)
08-31 07:52:10.000 4692-4692/? E/Twitter: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
08-31 07:52:10.000 4692-4692/? E/Twitter: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
After going through a lot of solutions, one that worked for me is just add - twittersdk:// as one more callback URL in the setting section of your twitter app.
Hope this help. It work well for me (https://www.assetstore.unity3d.com/en/#!/content/79450).
this is the best solution when twitter auth not working without app. i tried with valid firebase auth callback url but not working and i also search this problem a lot but not getting the exact solution, @Moinkhan solution worked for me and save my time, thanks to @Moinkhan, it works
Before this solution i tried valid url and even google.com too. But for my case it was not working.
i found below solution and it work well for me.
Step 1: go to your twitter app setting https://apps.twitter.com/ >> Tab settings >> Fill this text "twittersdk://" to your callback url field( i found it in lib class)
Step 2: Save your update
Step 3: check out your app again
I have same problem and solved. In my case i need to set callback url in twitter dev account.
Create your Your Access Token in Key and Access Token tab
I was facing the same issue(just moments back).
Go to Twitter Application Management ->
Click on the 'app' on which you are currently working ->
Click on 'Settings' tab ->
1) Callback URL: Insert any valid url(like homepage of your website)
2) Enable Callback Locking (It is recommended to enable callback locking to ensure apps cannot overwrite the callback url): Verify that it is unchecked
Reference:
Personal experience obtained moments back :P
Failed to get request token