开发者

Post on Facebook fan page as an application not user

i am using this to post on page or user profile :

      var fb = new FacebookOAuthClient(FacebookApplication.Current);
                dynamic resultt = fb.GetApplicationAccessToken();
                var appAccessToken = resultt.access_token;
                dynamic messagePost = new ExpandoObject();
                messagePost.access_token = appAccessToken;
                messagePost.picture = "http://www.destination360.com/europe/sweden/images/s/sweden-visby.jpg";
                messagePos开发者_开发技巧t.link = "http://www.destination360.com/europe/sweden/images/s/sweden-visby.jpg";
                messagePost.name = "[SOME_NAME]";
messagePost.from = "[SOME_Id]";
messagePost.to = "[SOME_Id]";
                messagePost.caption = "{*actor*} " + "[YOUR_MESSAGE]"; //<---{*actor*} is the user (i.e.: Aaron)
                messagePost.description = "[SOME_DESCRIPTION]";

                FacebookClient appp = new FacebookClient(appAccessToken);

                    var result = appp.Post("/" + appId + "/feed", messagePost);
                    var result2 = appp.Post("/" + "130736200342432" + "/feed", messagePost);

well when i try to post on page as an application it gives me this error :

(OAuthException) (#200) The user hasn't authorized the application to perform this action


There is some thing i figured out when you dealing with the application within facebook fan page you deal with it as a user and the same when you deal with it within the user profile you can publish on fanpage as a user not as an application and you can publish on the user wall as an application and as user the idea is you ask form user permission not for page permission which men you ask the user to give you permission on his own page soo the user have to log in and use you application and in your first action just post the message on the wall but if you are not owner of the page it will fire an exception i am sure if i am wrong any one correct me :)

you can use :

messagePost.from = "[SOME_Id]";
messagePost.to = "[SOME_Id]";

but this did not do any thing different with me ,so any one knows how to post in the wright way please share your experience or some suggestions .

thanks.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜