This is for the non native solution, just a responsive website I’m building. Everything works fine in the browser, but nothing happens when I call FB.login();
$(function() {
$.getScript("https//connect.facebook.net/en_US/all.js", function() {
FB.init({
appId : fbAppId,
status : true,
cookie : true,
oauth : true
});
alert(FB); // [object object]
FB.getLoginStatus(function(response) {
alert(response.status);
// if the iOS simulator is logged into facebook
// this says "connected"
// if the iOS simulator is NOT logged in
// it says "unknown"
});
FB.login(function(res) {
// never gets here on iOS simulator
// works fine on browsers
});
}
});
The problem is when I’m not logged into facebook, i’m trying to get the app to pop open the facebook looking screen. It never gets inside of FB.login, even though the same code works in the browser.
Thanks to anyone who can help!
It turns out, that you can’t call FB.init and then FB.login() on the mobile browser. I was trying to save loading the SDK until the user needed to login, but I guess I have to just use hover intent or something else.
Once I loaded the SDK on page load, then did FB.login() onclick() that was enough to get it working.
PITA