I'm trying to do do a Titanium.Facebook.authorize(), and it works on iPhone, but I get no reaction on Android.
The login event never get fired. :-/ Nothing gets printed to the log after 'Time to log in'.
Am I missing something?
Titanium.Facebook.appid = MY_APP_ID; Titanium.Facebook.permissions = ['publish_stream']; Titanium.Facebook.forceDialogAuth = true; // <--- Tried both if (Titanium.Facebook.loggedIn === true) { Ti.API.info('Already logged in!'); } else { Titanium.Facebook.addEventListener('login',function(e){ if (e.success) { Ti.API.info('Success!'); } else if (e.error) { Ti.API.info('error: ' + e.error); } else { Ti.API.info('Unknown error'); } }); Ti.API.info('Time to log in'); Titanium.Facebook.authorize(); }
2 Answers
when i alert() Titanium.Facebook.loggedIn i get a return of 1 and 0 for true and false. Says Boolean value in the doc, but it returns an int. maybe try if (Titanium.Facebook.loggedIn == 0) for false?
Replace === with ==
Your Answer
Think you can help? Login to answer this question!