@*********INDEX.XML************* @*************INDEX.JS**************** $.index.addEventListener("open", function() { if (Ti.Platform.osname === "android") { if (! $.index.activity) { Ti.API.error("Can't access action bar on a lightweight window."); } else { $.index.activity.actionBar.hide(); } } }); var fb = Alloy.Globals.Facebook; fb.appid = 000000; //actual appid has been removed //actual consumer secret and key have been removed var twitter = require('alloy/social').create({site:'twitter', consumerSecret:'SHHHH...SECRET',consumerKey:'CLASSIFIED'}); fb.addEventListener('login', function(e){ if(e.success){ $.fbLogin.setTitle("Logout of Facebook"); alert("Already logged in - go to another view."); } }); fb.addEventListener('logout', function(e){ $.fbLogin.setTitle("Login with Facebook"); }); if(twitter.isAuthorized()){ $.twitterLoginButton.setTitle("Logout of Twitter"); } else{ $.twitterLoginButton.setTitle("Login with Twitter"); } function statusUpdate(e){ if (fb.loggedIn) { fb.dialog('share', {href:'http://google.com'}, callback); } else{ alert("Please log into Facebook before sharing."); } function callback(e){ if(e.success){ Ti.API.info("Success: "+ e.result); alert("Message Posted Successfully."); } else if(e.error){ Ti.API.info(e.error); alert("Message cannot be posted at this time."); } } } function facebookLogin(){ if(fb.loggedIn){ fb.logout(); } else{ fb.authorize(); } } function twitterLogin(){ if(!twitter.isAuthorized()){ twitter.authorize(function(e){ Ti.API.info(e); if(e.userid.length > 0){ $.twitterLoginButton.setTitle("Logout of Twitter"); } }); } else{ twitter.deauthorize(); $.twitterLoginButton.setTitle("Login with Twitter"); } } function twitterShare(){ twitter.share({ message:"Hello dudes! #devtest", success: function(e){alert("success");}, error:function(e){alert("error");} }); } $.fbLogin.style = fb.BUTTON_STYLE_WIDE; $.index.open(); @********INDEX.TSS*********************** ".container": { backgroundColor:"#C24835" } "#loginView":{ layout:'vertical', top:100, backgroundColor:"#E7D8BC", backgroundGradient:{ type:'linear', startPoint: {x:'50%',y:'0%'}, endPoint:{x:'50%', y:'100%'}, colors:[{color:"#E7D8BC", offset:0.0},{color:"#f7f7f7", offset:1.0}] } } "#headerBar":{ top:20 } "Label": { color: "#474747",//"#33647C", textAlign: "center", font: { fontWeight:"bold", fontSize: 15, fontStyle:"italic" }, left:"20", right:"20" } ".login":{ height:55, width:250, borderColor:"#fff", borderRadius:20, color:"#fff", font:{ fontWeight:"bold", fontSize: 15, }, top:15 } "#fbLogin":{ backgroundColor:"#3b5998" } "#twitterLoginButton":{ backgroundColor:"#4FADEA" } ******ALLOY.JS************** Alloy.Globals.Facebook = require('facebook');