KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have a difficult problem. Difficult means I searched through the net and StackOverflow as well the whole FBJS SDK documentation and haven't find answer. I am building a Page Tab application where I'd like to let fans to rsvp events. So I have to check if the user is logged in and if it doesn't I have to login. That sounds pretty easy, but FB.getLoginStatus doesn't fires callback function. This is the code excerpt: FB.init({ appId: window.appID, status: true, xfbml: true, cookie: true, oauth: true, channelUrl: 'http://example.com/fb/channel.html' }); and then I simply - of course after the user clicks on a button - call FB.getLoginStatus, but it seems it doesn't do anything. I've already checked sandbox mode, FB.init success, URLs in application settings and developing environment. I can call FB.ui, although FB.ui with method: 'oauth' I get an error message saying " The "redirect_uri" parameter cannot be used in conjunction with the "next" parameter, which is deprecated.". Which is very weird because I didn't used "next" parameter. But when I set next to undefined, it works fine, I get the window, but it says "Given URL is not allowed by the Application configuration.". Expect from that, I can login, then I've got the access_token. But in the new window, getLoginStatus still doesn't do anything. So any advices are welcome. Thanks, Tamas UPDATE : function onBodyLoad() { //on body onload FB.init({ appId: window.appID, status: true, xfbml: true, cookie: true, oauth: true, channelUrl: 'http://example.com/fb/channel.html' }); } ... function getName() { // on button onclick FB.getLoginStatus(function(response){ if (response.authResponse) { window.loggedIn = true; debugString('Logged in'); } else { window.loggedIn=false; debugString('Not logged in'); } }, true); if (
Tags (comma-separated)
Save Edits
Cancel