Skip to content

Instantly share code, notes, and snippets.

@KarthiPnsmy
Created September 23, 2012 07:54
Show Gist options
  • Save KarthiPnsmy/3769260 to your computer and use it in GitHub Desktop.
Save KarthiPnsmy/3769260 to your computer and use it in GitHub Desktop.
ACS Social Integrations Part 1
var Cloud = require('ti.cloud');
Titanium.Facebook.appid = "285243484913611";//Production
Titanium.Facebook.permissions = ['publish_stream', 'read_stream'];
var win = Ti.UI.createWindow({
title : "ACS Social Integrations"
});
var fbSignupBtn = Ti.UI.createButton({
title : "Login with Facebook",
width : 160,
top : 50
});
win.add(fbSignupBtn);
fbSignupBtn.addEventListener('click', function() {
if (!Titanium.Facebook.loggedIn) {
Titanium.Facebook.authorize();
}
});
//add SocialIntegrations in Facebook login event listener
Titanium.Facebook.addEventListener('login', function(e) {
if (e.success) {
alert("login Success ");
//code for SocialIntegrations
} else if (e.error) {
alert("Error = " + e.error);
} else if (e.cancelled) {
alert("Canceld");
}
});
win.open();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment