Created
December 22, 2011 01:53
-
-
Save mauropm/1508550 to your computer and use it in GitHub Desktop.
FB ID
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
how about the alloy xml of this archive?? do you have it anywhere so I could take a look?