Posting to your Facebook wall
Now that you are able to authenticate against Facebook, it's time to post a photo from the gallery to your wall! To achieve this, you have to use Facebook's graph API, making a call to the correct graph function with the correct permissions.
How to do it...
We're going to extend our existing code to add a new button and function that will take some parameters and execute a graph request against the Facebook API.
Next, we need to create another button to post to Facebook. Add the following code after the code that adds the Facebook button to the window.
To start, let's add a new button that will sit under the login button but remain invisible until the login is successful. To do this, add the following code under the previous recipe's code:
//create your facebook session and post to fb function postToFacebookWall() { function postPhoto() { var data = { message : 'This is a photo9', picture : imageThumbnail.image }; fb.requestWithGraphPath...