How I can add a friend to my friends list?

Apr 10, 2014 at 2:56 AM

I wont to add a friend:
        TwitterCredentials.SetCredentials("AccesToken", "AccesTokenSecret", "ConsumerKey", "ConsumerKeySecret");
        var usuario = User.GetUserFromScreenName(TxtUsuario.Text);
        var YoUsuario = User.GetLoggedUser();
In the last line I've a exception because YoUsuario.Friends is a Null object

What's the correct method? Any can help me?

Apr 10, 2014 at 1:36 PM

What you want to use is :
Friends and Follower are always null. They are properties that developers can set on their own if they are willing to store the list of friends/followers retrieved from YoUsuario.GetFriends();.

I understand your confusion, I would like to add a method 'AddFriend' that would do the same as 'FollowUser' but I am not sure what is more easy to guess for developers.

Please let me know your point of view.

Marked as answer by linvi on 4/10/2014 at 5:36 AM
Apr 11, 2014 at 2:47 AM
Edited Apr 11, 2014 at 2:56 AM
I've tried to use ".FollowUser" method, but return always "false", that is, the user is not following. That's why I've tried ".Friends.add", but does not work.

Excuse me if my English is not very good. I'm Spanish, my english nivel is very basic and I use a translator program. :-)