1

I am Creating a library using Facebook C# SDK for windows phone.Facebook SDK Library version is 6.0.10.0. Facebook C# SDK contains asynchronous function calls only. In which there is a postCompleted event handler which takes object and FacebookApiEventArgs as arguments and return type is void.

I am using two classes one is UI class and other is Businesslogic class. from UI i want to call the BusinessLogic class(s) PostWall function which will simply return the last message id.

I want to create a function something like this

public string PostWall(string accessToken, string message)
{
    var fb = new FacebookClient(accessToken);

            fb.PostCompleted += (o, args) =>
            {
                if (args.Error != null)
                {                        
                    return;
                }
                var result = (IDictionary<string, object>)args.GetResultData();
                _lastMessageId = (string)result["id"];                        
            };

            var parameters = new Dictionary<string, object>();
            parameters["message"] = message;

            fb.PostAsync("me/feed", parameters);
}

I do not know how to implement this. Is this functionality achievable or not.

Any help appreciated Thanks in Advance

4

1 回答 1

1

您可以在https://github.com/facebook-csharp-sdk/facebook-windows-phone-sample查看 wp7 示例。

你所做的已经是正确的。

于 2012-10-23T00:25:07.010 回答