[SOLVED, but I\'m open to new suggestions...]
I\'m integrating Twitter into my Android app using twitter4j.
When I try to authorize with Twitter,
I guess there is nothing wrong with your code. I was getting the same result yesterday, but today it works like a charm. It is probably a server side issue. Could you try again your original (with no hacky part) solution, pls?
Use Below CallBack_URI for that, it may help you.
public static final String OAUTH_CALLBACK_SCHEME = "x-oauthflow-twitter";
public static final String OAUTH_CALLBACK_HOST = "callback";
public static final String CALLBACK_URL = OAUTH_CALLBACK_SCHEME + "://" + OAUTH_CALLBACK_HOST;
I found I just could not get it to work this way after following the guides I've seen online.
I ended up using my own custom WebViewClient
with the code:
if ( url.contains( "MY-CALLBACK:///" ) )
{
final int start = url.indexOf( '?' ) + 1;
final String params = url.substring( start );
final String verifierToken = "oauth_verifier=";
if ( params.contains( verifierToken ) )
{
final int value = params.indexOf( verifierToken ) + verifierToken.length();
final String token = params.substring( value );
view.stopLoading();
authoriseNewUser( token );
}
else if ( params.contains( "denied" ) )
{
view.stopLoading();
finish();
}
}
else
{
view.loadUrl( url );
}
return true;
public static final String OAUTH_CALLBACK_SCHEME = "x-oauthflow-twitter";
public static final String OAUTH_CALLBACK_HOST = "litestcalback";
public static final String OAUTH_CALLBACK_URL = OAUTH_CALLBACK_SCHEME+ "://" +OAUTH_CALLBACK_HOST;
use this type of callback_url in code and manifest file...