user3656969
user3656969

Reputation: 21

How to share Picture on Facebook from my Windows Phone app?

I've saved an image in "Saved Pictures" Album. I would like to share this image on Facebook. How do I do that?

Upvotes: 0

Views: 366

Answers (1)

Ertay Shashko
Ertay Shashko

Reputation: 1257

I assume that you do not want to install the Facebook SDK for advanced features etc. and you are talking about sharing the image with the built in share task.

Since you haven't provided any code of what you've done this is how you can get the last picture that is saved in the Saved Pictures album:

MediaLibrary library = new MediaLibrary();
var picture = library.SavedPictures[library.SavedPictures.Count - 1];

Now in picture you have the last image that is in Saved Pictures. To launch a share media task that will display all the apps that can share the image you write the following:

ShareMediaTask shareMediaTask = new ShareMediaTask();
shareMediaTask.FilePath = picture.GetPath();
shareMediaTask.Show();

Upvotes: 2

Related Questions