List of usage examples for twitter4j AsyncTwitter verifyCredentials
void verifyCredentials();
From source file:com.marpies.ane.twitter.functions.InitFunction.java
License:Apache License
@Override public FREObject call(FREContext context, FREObject[] args) { super.call(context, args); if (TwitterAPI.isInitialized()) return null; String consumerKey = FREObjectUtils.getString(args[0]); String consumerSecret = FREObjectUtils.getString(args[1]); String urlScheme = FREObjectUtils.getString(args[2]); Boolean showLogs = FREObjectUtils.getBoolean(args[3]); AIR.setLogEnabled(showLogs);/*from w w w . j a v a 2 s . co m*/ TwitterAPI.init(consumerKey, consumerSecret, urlScheme); /* Verify cached access tokens */ if (TwitterAPI.hasAccessTokens()) { AIR.log("Verifying credentials"); AsyncTwitter twitter = TwitterAPI.getAsyncInstance(TwitterAPI.getAccessToken()); twitter.addListener(this); twitter.verifyCredentials(); } else { AIR.dispatchEvent(AIRTwitterEvent.CREDENTIALS_CHECK, "{ \"result\": \"missing\" }"); } return null; }