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)

0
Logesh Palani

Logesh Palani

  • 182
  • 10k
  • 1.9m
Oct 23 2018 6:31 AM
Hello one Good Day :)
Solved, the problem was the application was not published yet .. it was on the developer mode that makes no one can see the posts except the application admins.
First Install the Facebook SDK and authendicate to develop the aplication
SDK Download - https://www.youtube.com/watch?v=ab-CAjKBDss
Authendication - https://www.youtube.com/watch?v=tSV28Tdscog
Accepted Answer