Can't create or destroy friendship

Oct 20, 2013 at 10:34 AM
Hello,

I am trying to unfollow a user on my Windows Phone app using the code below:
                TwitterContext.DestroyFriendship("", currentUser.Identifier.ScreenName, (asyncResponse) =>
                {
                    if (asyncResponse.Status == TwitterErrorStatus.Success)
                    {
                        following = false;
                    }

                    Dispatcher.BeginInvoke((Action)delegate
                    {
                        RefreshUI();
                    });
                });
But this request fails and throws exception saying: "Could not authenticate you".

From what I see in debugger, the screen name is passed correctly.

Creating a friendship does not work, either, giving the same error message. I am able to do other kind of queries without a problem though, like querying statuses, users, friendships, favoriting a status etc. I am using SingleUserAuthorizer with "Read, Write and Access direct messages" credentials all set on Twitter dev account.

What might be the problem?
Coordinator
Oct 20, 2013 at 9:59 PM
Hi,

I couldn't reproduce the exact error message, but try setting the unused parameter to null instead of "".

@JoeMayo
Marked as answer by canol on 10/20/2013 at 2:13 PM
Oct 20, 2013 at 10:13 PM
JoeMayo wrote:
Hi,

I couldn't reproduce the exact error message, but try setting the unused parameter to null instead of "".

@JoeMayo
Changing "" to null did the trick :) Thanks.

Just for the record, in FriendshipDemos.cs, string.Empty is used for unused parameters and it doesn't work, either (at least on Windows Phone 8). The wiki documentation, though, uses null and it works without a problem.