Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Facebook Module not working with with SDK 4.0

$
0
0

Hello, I been with this issue for the last few days and I can't make it work. I am trying to add a login via facebook feature to my app, and everything seems to work fine, I can see the Facebook dialog, and authorize my app, but then nothing happens, fb.loggedIn will always return false and I see the following in the console:

[DEBUG] :  FacebookProxy: (main) [10761,16606] Facebook proxy onResume
[DEBUG] :  FacebookProxy: (main) [1,16607] session is null or session is in intermediate state
I am using the following code to test it https://github.com/phollyer/appc_facebook_login/tree/facebook_public/app

Login looks like this

var facebook = require('facebook');
facebook.permissions = ['email'];
 
facebook.addEventListener('login',function(e) {
    // You *will* get this event if loggedIn == false below
    // Make sure to handle all possible cases of this event
 
    Ti.API.info('Facebook login event');
 
    if (e.success) {
        var fbSignedIn = Alloy.createController('facebookSignedIn').getView();
        fbSignedIn.fbProxy = facebook.createActivityWorker({lifeCycleContainer: fbSignedIn});
        fbSignedIn.open();
    }
    else if (e.cancelled) {
        // user cancelled 
        alert('cancelled');
    }
    else {
        alert(e.error);         
    }
});
 
facebook.initialize();
Was anyone able to make it work using SDK 4.0 and alloy? Any help will be really appreciated!

Thanks!


Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>