简体   繁体   中英

How to post to user's wall from application's name?

I tried to post to users wall using application access token but it still posts from users name. Is it possible to post from application's name?

var fbc = new FacebookWebClient();
        var wc = new WebClient();
        var tokenStr = wc.DownloadString(string.Format("https://graph.facebook.com/oauth/access_token?client_id={0}&client_secret={1}&grant_type=client_credentials",
            FacebookApplication.Current.AppId, FacebookApplication.Current.AppSecret));

        fbc.AccessToken = tokenStr.Replace("access_token=", string.Empty);

        dynamic parameters = new ExpandoObject();
        parameters.message = "testMessage";
        //parameters.link = pageLink;
        parameters.name = "testCaption";

        dynamic result = fbc.Post(string.Format("{0}/feed", userID), parameters);
var fbPost = new FacebookClient ( accessToken );
         dynamic result = fbPost.Post ( "me/feed", new { message = "Welcome to C# SDK and me" } );

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM