I am using the code from the appcelerator docs like this:
var fb = require('facebook');
fb.addEventListener('login', function(e) {
Ti.API.info("Login event received...");
if (e.success) {
alert('login from uid: '+e.uid+', name: '+ JSON.parse(e.data).name);
}
else if (e.cancelled) {
// user cancelled
alert('cancelled');
}
else {
alert(e.error);
}
});
Ti.API.info("fb authorize...");
fb.permissions = ['public_profile'];
fb.initialize();
fb.authorize();
But the login event is never fired and nothing happens. Anyone have any idea why?
I am using appcelerator studio 5.2.2.GA and iOS 9.3.1 on iPhone.