Example usage for twitter4j AsyncTwitter destroyFriendship

List of usage examples for twitter4j AsyncTwitter destroyFriendship

Introduction

In this page you can find the example usage for twitter4j AsyncTwitter destroyFriendship.

Prototype

void destroyFriendship(long userId);

Source Link

Document

Allows the authenticating users to unfollow the user specified in the ID parameter.
Returns the unfollowed user in the requested format when successful.

Usage

From source file:com.marpies.ane.twitter.functions.UnfollowUserFunction.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]);
    mCallbackID = FREObjectUtils.getInt(args[2]);

    AsyncTwitter twitter = TwitterAPI.getAsyncInstance(TwitterAPI.getAccessToken());
    twitter.addListener(this);
    if (screenName != null) {
        twitter.destroyFriendship(screenName);
    } else {//from   ww w.  j  a va 2 s.  c  om
        twitter.destroyFriendship(userID);
    }

    return null;
}