[AC-4391] Facebook module loggedIn never true
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Resolved |
Resolution | Invalid |
Resolution Date | 2016-08-28T16:37:19.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Titanium SDK & CLI |
Labels | n/a |
Reporter | Alexander Rieger |
Assignee | Shak Hossain |
Created | 2016-08-25T06:03:44.000+0000 |
Updated | 2016-08-28T16:37:20.000+0000 |
Description
I am using authorize function from Facebook module. In the past once I authorized with Facebook then the next time the app ist started newly I got loggedIn true or EventListener('login') was fired. Now this is not happening any more. Since my app code is calling then authorize again it always jumps to Facebook screen saying that the app is already authorized.
exports.facebook = require('facebook');
exports.facebook.permissions = ['email','user_friends'];
exports.facebookLogin=function() {
exports.facebook.addEventListener('login', faceBookLoginEvent);
exports.facebook.initialize();
exports.facebook.authorize();
};
This part always ends in calling facebookLogin, even after it is authorized once.
if (exports.facebook.loggedIn) {
facebookLoggedIn();
} else {
exports.facebookLogin();
}
The code-style with all those
exports
statements causes problems with your application logic. I just verified that the loggedIn property works well when being called on a regular ti.facebook instance (e.g.var fb = require("facebook);
). Ensure that your scope is correct and only useexports
if you want something to be accessible from other components / controllers.