Twitter login throwing OAuthNotAuthorizedException in Android 4.3 and 4.4

I've integrated twitter in one of my application using Twitter4j, But I am not able to login in Android 4.3 and Android 4.4 devices and rest of the other devices it working fine. Following is the code snippet

consumer = new CommonsHttpOAuthConsumer("consumerKey", "consumerSecret");
provider = new CommonsHttpOAuthProvider("https://api.twitter.com/oauth/request_token", 
                    "https://api.twitter.com/oauth/access_token", 
                    "https://api.twitter.com/oauth/authorize");

oauthUrl = provider.retrieveRequestToken(consumer, "myapp://twitterOauth");

and loading oauthUrl in WebView and retrieve the accessToken. It throwing OAuthNotAuthorizedException.

Any help would be greatly appreciated!

Answers


In case you are not doing it already, you have to specify the consumer key and secret that you got from the Twitter API...

Take a look at this tutorial which uses the AndroidTwitter library, which in turn integrates Twitter4j and the signpost library to access the Twitter API from your app.


Need Your Help

.NET Unit Testing packages?

c# .net unit-testing testing

Getting back into a bit more .NET after a few-years of not using it full-time, and wondering what the good unit testing packages are these days.

Xpages ajax request impacts context history

xpages lotus-domino lotus xpages-ssjs

I have a simple Xpage (page1.xsp) opened from view.xsp page. It contains the following elements