O'Reilly logo

Appcelerator Titanium Smartphone App Development Cookbook - Second Edition by Jason Kneen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required