Question

I am trying to post something on my friend's timeline and I keep on getting an error every time i try to do it. the code i am using is below. i wonder if the code is correct? Cause it doesn't work for me. Can you help?

dynamic parameters = new ExpandoObject();
if (!string.IsNullOrEmpty(action.Post.PictureLocalSource))
{
     var pictureTracking = GetNextPhotoFromFolder(action.Post.PictureLocalSource);
     if (pictureTracking != null)
     {
         //  action.Post.Picture = pictureTracking.FBPictureRef; // org
         action.Post.Link = pictureTracking.FBPictureRef;
         action.Post.Picture = pictureTracking.TrackingFileName;
         parameters.type =  "";
      }
}
parameters.to = action.FacebookPostTargetID;
//parameters.Add("from", MyFacebookID);
parameters.message=action.Post.Message.Trim();
parameters.link = action.Post.Link;
parameters.picture = action.Post.Picture;
parameters.source = action.Post.Source;
parameters.name  = action.Post.Name;
string caption = action.Post.Caption;
if (caption.Length > 200)
    caption = caption.Substring(0, 200);
parameters.caption = caption.Trim(); // "Σχετικά με το asfame.gr";
parameters.description=action.Post.Description;
string feedtype = "";
if (action.Type == ActionType.Comments)
    feedtype = "comments";
else
    feedtype = "feed";
parameters.method = feedtype;
result = Client.Post(parameters);
Was it helpful?

Solution

Facebook has removed the ability to post on friends wall from 6th feb,2013. checkout the official doc here http://developers.facebook.com/roadmap/completed-changes/ under subsection Removing ability to post to friends walls via Graph API from February 6, 2013 changes. Hope it helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top