Trying to post directly to an application's wall

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-08 08:20:05

问题


I'm trying to post directly to an application's wall without linking it to my account. I keep getting a "(OAuthException) (#200) The user has not granted the application the permission to automatically publish feed stories". This is from a winform application.

        var oAuthClient = new FacebookOAuthClient();
        oAuthClient.AppId = "APP_ID";
        oAuthClient.AppSecret = "APP_SECRET";
        dynamic token = oAuthClient.GetApplicationAccessToken();

        var appToken = token.access_token;

        FacebookClient fbClient = new FacebookClient(appToken.ToString());
        var args = new Dictionary<string, object>();
        args["message"] = "Testing 123456789 from C#";
        fbClient.Post("/APP_ID/feed", args);

回答1:


Citing from facebook docs for stream.publish:

Posting to Your Application's Profile Page

In order to use stream.publish to post on the Wall of your application profile page (your application's About Page), all the following conditions must be true:

  • The posting user needs to grant the application the publish_stream extended permission.
  • The posting user must like the application's profile page.
  • A developer of the application must edit the application profile page's Wall Settings (Edit Application > Edit) and verify under Posting Ability that Fans can write or post content on the wall is checked.

From this it is obvious you cannot post to application wall with application token, only with token of user that likes the app.



来源:https://stackoverflow.com/questions/8173699/trying-to-post-directly-to-an-applications-wall

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!