Titanium JIRA Archive
Appcelerator Community (AC)

[AC-4391] Facebook module loggedIn never true

GitHub Issuen/a
TypeBug
Priorityn/a
StatusResolved
ResolutionInvalid
Resolution Date2016-08-28T16:37:19.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsn/a
ReporterAlexander Rieger
AssigneeShak Hossain
Created2016-08-25T06:03:44.000+0000
Updated2016-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();
		}

Comments

  1. Hans Knöchel 2016-08-28

    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 use exports if you want something to be accessible from other components / controllers.

JSON Source