Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

how to make logout facebook

$
0
0

I want to make a logout facebook button wchich return me from menu page to the index page here my code: Titanium.UI.setBackgroundColor('#CC0066');

var win = Titanium.UI.currentWindow; var main = Titanium.UI.createWindow({ background : "#fff", title : "Image View", url:"app.js" });

// this sets the background color of the master UIView (when there are no windows/tab groups on it)

var fb = require('facebook'); fb.appid = "281158112043247"; win.add(fb.createLoginButton({ top : 140, style : fb.BUTTON_STYLE_WIDE, url:'Controller/login.js' }));

fb.addEventListener('logout', function(e) { if(e.success) { if(fb.logout){

Ti.App.fireEvent('grantEntranc', e);
win.close();

}

} });

and Ti.App.addEventListener('grantEntranc', function(event) { main.tabBarHidden = true; main.title = 'Welcome ' ; main.url = 'Controller/app.js'; main.name = event.Userlogin; main.email = event.Useremail; mainTab.window = main;

tabGroup.addTab(loginTab);
tabGroup.addTab(accountTab);

});


Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>