Skip to content

Instantly share code, notes, and snippets.

@mauropm
Created December 22, 2011 01:53
Show Gist options
  • Save mauropm/1508550 to your computer and use it in GitHub Desktop.
Save mauropm/1508550 to your computer and use it in GitHub Desktop.
FB ID
var win = Ti.UI.createWindow({});
var sv = Ti.UI.createScrollView({
contentWidth:'auto',
contentHeight:'auto',
top:0,
showVerticalScrollIndicator:true,
showHorizontalScrollIndicator:true
});
win.add(sv);
Titanium.Facebook.appid = "134793934930";
Titanium.Facebook.permissions = ['publish_stream', 'read_stream'];
//
// Login Button
//
var fbButton = Titanium.Facebook.createLoginButton({
style:'wide',
top: 10
});
sv.add(fbButton);
var b1 = Ti.UI.createButton({
title:'Display Properties',
width:200,
height:40,
top:50
});
sv.add(b1);
var loggedIn = Ti.UI.createLabel({
title:'',
height:'auto',
width:300,
top:95,
font:{fontSize:13},
color:'#777'
});
sv.add(loggedIn);
var userId = Ti.UI.createLabel({
title:'',
height:'auto',
width:300,
top:130,
font:{fontSize:13},
color:'#777'
});
sv.add(userId);
b1.addEventListener('click', function()
{
Ti.API.info("click called, logged in = "+Titanium.Facebook.loggedIn);
if (!Titanium.Facebook.loggedIn)
{
Ti.UI.createAlertDialog({title:'Facebook', message:'Login before accessing properties'}).show();
return;
}
loggedIn.text = "Logged In = " + Ti.Facebook.loggedIn;
userId.text = "User Id = " + Ti.Facebook.uid;
Ti.API.info(loggedIn.text);
Ti.API.info(userId.text);
});
win.open();
@gabrielamota29
Copy link

how about the alloy xml of this archive?? do you have it anywhere so I could take a look?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment