你好,我在使用JTwitter函数验证我的twitter应用程序时遇到了困难。我一直收到"TwitterException"的错误提示。
以下是我的方法:
OAuthSignpostClient oauthClient = new OAuthSignpostClient(consumerKey,
privateKey, "oob");
a) 我不知道 "oob" 值应该是什么,它是 "callbackURL",在我的 Twitter 应用程序中它说 "callBack URL: none"
,所以我尝试将 "oob"
替换为 "none"
、"None"
和 null
,但结果没有区别。
剩下的部分是样板文件。
Intent i = new Intent(Intent.ACTION_VIEW,
Uri.parse(oauthClient.authorizeUrl().toString()));
startActivity(i);
// get the pin
String v = oauthClient.askUser("Please enter the verification PIN from Twitter");
oauthClient.setAuthorizationCode(v);
// Store the authorisation token details for future use
String[] accessToken = oauthClient.getAccessToken();
// Next time we can use new OAuthSignpostClient(OAUTH_KEY, OAUTH_SECRET,
// accessToken[0], accessToken[1]) to avoid authenticating again.
EditText twitterText = (EditText)findViewById(R.id.twitterText);
twitterText.getText();
// Make a Twitter object
Twitter twitter = new Twitter(null, oauthClient);
// Print Daniel Winterstein's status
//System.out.println(twitter.getStatus("winterstein"));
// Set my status
twitter.setStatus(twitterText.getText());
目前,我不确定如何使其正常工作。希望我能更详细地说明,但这与身份验证有关。我看到的在线信息并没有提供帮助。