Along with Twitter, iOS also supports adding a Facebook account via the settings, which allows applications, once they have permission, to gain access to your account without going through the full Facebook login.
First, you need to ensure you're set up on Facebook in the iOS settings. Launch the settings app, then go into Facebook and log in with your credentials. Once you've given permission to access your Facebook account, applications can make requests to use your credentials.
Once you're set up with Facebook, add the following code to the bottom of app.js
:
var postToFacebookFromiOS = Ti.UI.createButton({ width : 280, height : 40, top : 430, left : 20, title : 'Post to Facebook from iOS', }); postToFacebookFromiOS.addEventListener("click", function() { // create a function we can call later function postToFacebook() { fb.reauthorize(['publish_stream'], 'me', function(e) { if (e.success) { var data = { ...