I am developing a console app with c# to autopost photos to my facebook page. The code below does the job successfully (post photo to facebook page) but all my photos gets '0 person viewed' although they are public:
var fb = new FacebookClient(access_token);
var argList = new Dictionary<string, object>();
var media = new FacebookMediaObject
{
FileName = System.IO.Path.GetFileName(path),
ContentType = "image/jpg"
};
media.SetValue(System.IO.File.ReadAllBytes(path));
argList["source"] = media;
fb.Post("/{page_id}/photos", argList);
So I think the problem is with the last line of code, I should write
fb.Post("/{page_id}/feed", argList);
instead of this:
fb.Post("/{page_id}/photos", argList);
But whenever I try this, I get this exception:
(OAuthException - #100) (#100) source should represent a valid URL
I have seen some examples on the net where the method Post
have just one parameter like that:
fb.Post(argList);
But when I have tried it, I got this exception
(GraphMethodException - #100) Unsupported post request. Please read the Graph API documentation
Note: when I post a picture normally from the page without a 3rd party, the post gets around 300 views.
So what's wrong with my code ? How can I post a picture from my app and got shown like it is posted from an account ?