List of usage examples for twitter4j AsyncTwitter createFriendship
void createFriendship(long userId, boolean follow);
From source file:com.marpies.ane.twitter.functions.FollowUserFunction.java
License:Apache License
@Override public FREObject call(FREContext context, FREObject[] args) { super.call(context, args); long userID = FREObjectUtils.getDouble(args[0]).longValue(); String screenName = (args[1] == null) ? null : FREObjectUtils.getString(args[1]); boolean enableNotifications = FREObjectUtils.getBoolean(args[2]); mCallbackID = FREObjectUtils.getInt(args[3]); AsyncTwitter twitter = TwitterAPI.getAsyncInstance(TwitterAPI.getAccessToken()); twitter.addListener(this); if (screenName != null) { if (enableNotifications) { twitter.createFriendship(screenName, true); } else {//from w ww . j ava2 s . c o m twitter.createFriendship(screenName); } } else { if (enableNotifications) { twitter.createFriendship(userID, true); } else { twitter.createFriendship(userID); } } return null; }