Search code examples
iosxcodetwittersttwitter

Change User Follow/Unfollow using STTwitter


I initially staretd with twitter-fabrc but as their was not much documentation about how to extend the one-click login to access twitter sdk, shifted to STTwitter. Here i understand the login flow and getting user tweets but how do access the Rest API Endpoints https://dev.twitter.com/rest/public to make/destruct follow/unfollow relationships. Or suggest me a better way to go about it.


Solution

  • Use the following STTwitterAPI methods:

    // POST friendships/create
    - (void)postFriendshipsCreateForScreenName:(NSString *)screenName
                                      orUserID:(NSString *)userID
                                  successBlock:(void(^)(NSDictionary *befriendedUser))successBlock
                                    errorBlock:(void(^)(NSError *error))errorBlock;
    
    // POST friendships/destroy
    - (void)postFriendshipsDestroyScreenName:(NSString *)screenName
                                    orUserID:(NSString *)userID
                                successBlock:(void(^)(NSDictionary *unfollowedUser))successBlock
                                  errorBlock:(void(^)(NSError *error))errorBlock;