Click here to Skip to main content
15,895,011 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am implementing Post on Wall of friend using Facebook C# SDK, i have made separate FB apps for my localhost and for publishing server, the problem is arising is that it is working fine on my localhost,but when i am running publishing site it is not posting on wall, but showing Posted on Wall successfully( The message i am showing if wall post is successfull) i am providing AppID and AppSecret properly Below is my code of posting on wall of friend.

C#
var fbApplication = new DefaultFacebookApplication { AppId = fbapp, AppSecret = fbsec };
                var current = new FacebookWebContext(fbApplication);

                Facebook.Web.FacebookWebClient client = new Facebook.Web.FacebookWebClient(fbtoken);                  
                dynamic parameters = new ExpandoObject();
                parameters.message = "";
                parameters.link = "Link to my Website";
                parameters.name = "Name";
                parameters.caption = "MyTitle";
                parameters.description = "Hello World";
                parameters.from = fromId;

            object resTest = client.Post("/" + friendId + "/feed", parameters);
Posted

1 solution

Hello,

I am using FacebookClient instead of FacebookWebClient and working perfectly.
I am using this in a windows application.

Try to use something like this:
C#
var fb = new FacebookClient(_accessToken);
dynamic parameters = new ExpandoObject();

parameters.message = "Message";
fb.Post(me/feed, parameters);

Hope you get the solution.

Happy coding.
 
Share this answer
 
v2
Comments
André Kraak 6-Mar-12 14:31pm    
Edited solution:
Added pre tags
Syed Salman Raza Zaidi 7-Mar-12 5:48am    
The same problem is arising :( after publishing it is not posting on wall :(
sankalp sawant 5-Apr-14 9:20am    
how to use it in offline mode to post to user wall using FaceBookId received from logging

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900