WPF c# Integration With Facebook and Share Image on Timeline

Sep 12 2018 10:09 AM
Hi,
 
I am integrating wpf c# application with facebook and share image on facebook timeline.
 
While i am doing my connection is successful, while i am removing scopes but when posting image on facebook timeline it shows error 200 and shows facebook deprecated the version to publish the images.
 
Now Share Dialog to Share images and for Native Desktop application :
 
https://developers.facebook.com/docs/facebook-login/for-devices
public void UploadContent()
{
string photoAlbumID = "199967900755629";
FacebookMediaObject facebookUploader = new FacebookMediaObject { FileName = "Carnival-Mask-Costume-Ideas-800x600.jpg", ContentType = "image/png" };
//var bytes = File.ReadAllBytes(System.IO.Path.GetDirectoryName(System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName) + "\\" + facebookUploader.FileName);
var bytes = File.ReadAllBytes(@"D:\Gallery\Carnival-Mask-Costume-Ideas-800x600.jpg");
facebookUploader.SetValue(bytes);
var postInfo = new Dictionary<string, object>();
postInfo.Add("message", "test photo");
postInfo.Add("image", facebookUploader);
postInfo.Add("access_token", fbtoken.AccessToken);
var fbResult = fbtoken.Post("/" + photoAlbumID + "/photos", postInfo);
dynamic result = (IDictionary<string, object>)fbResult;
}
 
Please help me out to connect facebook and share image on facebook timeline.
Facebook Appid and secret Key, Client Token I have.

Answers (1)