I am using alloy to create app to access to my friends list and add them to a list in my app.This is my code Thanks.
$.win.open(); Ti.Facebook=Titanium.Facebook = require('facebook'); Ti.Facebook.appid = 284575574901135; Ti.Facebook.permissions = ['publish_stream']; // Permissions your app needs Ti.Facebook.forceDialogAuth = true; var btnLogin = Titanium.UI.createButton({ title: 'Login', top: 10, width: 100, height: 50 }); $.win.add(btnLogin); btnLogin.addEventListener('click',function(e) { Ti.Facebook.addEventListener('login', function(e) { if (e.success) { alert('Logged In'); console.log(JSON.stringify(e)); } else if (e.error) { alert(e.error); } else if (e.cancelled) { alert("Canceled"); } }); Ti.Facebook.authorize(); }); var btnLogout = Titanium.UI.createButton({ title: 'Log out', top: 80, width: 100, height: 50 }); $.win.add(btnLogout); btnLogout.addEventListener('click',function(e) { Ti.Facebook.addEventListener('logout', function(e) { alert('Logged out'); }); Ti.Facebook.logout(); });