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

Facebook Login Not Working (Android)

$
0
0

Hi, I'm using very simple code on my Android app to login a user to Facebook. What's wierd is the very first time I tested on my device it worked. Since then nothing happens. I can see via the debug that the call to authorize happens but none of the events occur. If I delete the app from my phone and reinstall the dialog works again.

Here's my code:

function doFBLogin(){
    var fb = require('facebook');
    fb.appid = 104282522964675;
    fb.permissions = ["email","publish_actions"];
    fb.forceDialogAuth = true;
 
    Ti.API.info("Authorize FB");
    fb.addEventListener('login', function(e) {
        Ti.API.info("event "+JSON.stringify(e));
        if (e.success) {
            alert('Logged In');
        } else if (e.error) {
            alert(e.error);
        } else if (e.cancelled) {
            alert("Canceled");
        }
    });
    fb.addEventListener('logout',function(e){
        Ti.API.info(JSON.stringify(e));
    });
    fb.authorize();
}

Viewing all articles
Browse latest Browse all 8068

Trending Articles



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