Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I post on the Facebook user's wall with a metro app (Windows 8)?

I'm creating a Metro App for Windows 8 with HTML5 and JavaScript, that needs to post a picture on the user's wall.

I'm using Windows Authentication Broker to get the access token, and with that I can get the user data.

The problem is I can't use Facebook SDK for Javascript in a Metro app, that includes the calling to Graph Api to make the post.

So, how can I post something without this? Can I use the way that Windows proposes to sharing data? That is using a DataPackage (http://msdn.microsoft.com/en-us/library/windows/apps/hh465261.aspx )

If it's possible... How can I do this?

like image 966
mb_gud Avatar asked Oct 05 '22 16:10

mb_gud


1 Answers

You don't need to use the Facebook Javascript SDK. If you already got the token, you are half way there.

You should send an HTTP POST to "https://graph.facebook.com/USER_ID/photos" with the access token (you must have publish_stream permissions). Facebook API Docs > Photo

To send an HTTP post you can use WinJS.xhr() or jQuery.ajax() if you are using jQuery.

like image 157
Tarek Ayna Avatar answered Oct 10 '22 03:10

Tarek Ayna