FriendsOfSymfony / FOSFacebookBundle

NOT MAINTAINED - see https://github.com/hwi/HWIOAuthBundle
321 stars 140 forks source link

FBML login button not changing the state correctly on page load. #76

Open reisba opened 12 years ago

reisba commented 12 years ago

I don't know if anyone else has had this issue, but the fbml login button doesn't seem detect 'logged in' status correctly with autologoutlink: true. Meaning: regardless if I am logged into facebook or not, the fbml login button is always displayed in "log in"-state on initial page load.

However running FB.getLoginStatus seemed to automatically set the fbml-button to correct state. If this issue is repeating on others, it might be good to mention it in your documentation.

                  FB.getLoginStatus(function(response) {
                      if (response.authResponse) {
                        // Do something for logged in users
                      } else {
                          // User is not logged in to fb
                      }
                    });'
michelsalib commented 12 years ago

While this seams weird, your workaround did the trick. Thanks

julesbou commented 12 years ago

Check: http://developers.facebook.com/docs/reference/javascript/FB.getLoginStatus/ (section Checking user status on page load)

You could use this instead of: {{ facebook_initialize({'xfbml': true, 'status': true, 'fbAsyncInit': 'onFbInit();'}) }}