Posting to Facebook only available to admin c#

巧了我就是萌 提交于 2019-12-08 05:37:51

问题


I can successfully post to Facebook, however the posts are not public that everyone can see, only the primary page admin. Even after manually going through each post and "approving" them they are still not publicly available. I posted the question to Facebook and got a thank you for posting a question but no answer.

I created a Facebook app then using Facebook Graph API I got some access tokens for the app and made the access token permanent.

I can post using the Facebook SDK for .Net but again on the primary page admin can see the posts and nothing will make them visible.

Here is the access token info:

App ID  435958876564133 : RROADSus
Profile ID  830833833664593 : RROADSus
User ID
596954487156779 : Janel Xxxxx
User last installed this app via API N/A
Issued  1487528725 (about a month ago)
Expires Never
Valid   True
Origin  Web
Scopes  manage_pages, publish_pages, pages_manage_cta, publish_actions, public_profile

Here is the code in the class to post to Facebook:

    public static void postGotRV_FB(string Msg, string Picture, string Link, string Caption, string Desc)
    {
        string fb_Token = ConfigurationManager.AppSettings["fb:PermToken"];
        FacebookClient client = new FacebookClient(fb_Token);

        dynamic messagePost = new ExpandoObject();
        messagePost.access_token = fb_Token;

        messagePost.message = Msg.ToString().Trim();

        if (string.IsNullOrEmpty(Picture) == false)
        {
            Picture = Picture.Replace("../", "http://www.RROADS.us/");
            messagePost.source = Picture;
        }

        if (string.IsNullOrEmpty(Link) == false)
            messagePost.link = Link.ToString().Trim();

        if (string.IsNullOrEmpty(Caption) == false)
            messagePost.caption = Caption.ToString().Trim();

        if (string.IsNullOrEmpty(Desc) == false)
            messagePost.description = Desc;

        var result = client.Post("/830833833664593/feed", messagePost);
    }

Here is the code I am calling to test the function off a button keypress:

    protected void Unnamed1_Click(object sender, EventArgs e)
    {
        //string image = "Got-RV.png";
        string image = "../Images/RROADS.png";
        string Msg = "Hello From RROADS.us";
        string Link = "http://www.RROADS.us";
        string Caption = "Image Caption";
        string Desc = "This is my test Description";

        SocialMedia.postGotRV_FB(Msg, image, Link, Caption, Desc);
    }

The post appears when you view the page as admin :

Hello From RROADS.us
<< IMAGE IS HERE >>
The Heart of Your Adventure
This is my test Description
IMAGE CAPTION

But when you view the page as anyone else this post does not appear.

What am I missing?

Thank you in advance!

来源:https://stackoverflow.com/questions/43034438/posting-to-facebook-only-available-to-admin-c-sharp

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