Facebook login button is not showing up
According to the Facebook documentation if you have the show-faces
attribute set to true
and the user is already logged in, no login button will be shown. Try changing it to false
so the login button is shown even if the user is logged in.
You can find more info here: https://developers.facebook.com/docs/reference/plugins/login/
Related videos on Youtube
Balázs Németh
Software architect and developer with special interest in agile, DevOps and how people interact and work together in organizations. I have 10+ years experience in software development, and most of that time I spent in the Java ecosystem. I'm a big fan of automated testing, continuous integration and continuous deployment. Specialties: Java, Docker, Spring Boot, Restful services, micro services, Apache Kafka, Event sourcing, CQRS, ansible, agile, continuous everything! I'm also comfortable with: Kubernetes, Scala, NodeJS
Updated on June 04, 2022Comments
-
Balázs Németh almost 2 years
I'm using facebook login on a site to make it easier for users to login or register but I just realised that the login button is not showing up if I'm logged in into facebook. If I log out, it's displayed the expected way.
It used to work before, maybe 2 months earlier but it does not work now.
The fb:login tag is used like this:
<fb:login-button onlogin="myJScript();" />
...
<script type="text/javascript"> window.fbAsyncInit = function() { FB.init({appId: '#{serviceBean.FACEBOOK_API_KEY}', status: true, cookie: true, xfbml: true}); }; (function() { var e = document.createElement('script'); e.async = true; e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js'; document.getElementById('fb-root').appendChild(e); }()); </script>
So nothing special...
Has something changed in the usage of this fb:login?
-
Neelam over 12 yearsCheck your javascript console for any erors. and also see that AppId is present
-
Balázs Németh over 12 yearsThere aren't any errors and the AppId is present. It works when I logout from facebook. But on my page the same html gets rendered regardless of that of course.
-
Neelam over 12 yearsInstead of using facebook login button,you can also go other way around.You can have a normal asp buton with facebook image on it and have the facebook code running on the client click event of this button.This way you can handle the aspx button the way u want.Thats how i did it in my website.
-
-
Balázs Németh over 12 yearsthanks for the answer. still getting the issue, now trying with the updated fb scripts and see if there's a change... if it's not working, i'll try your solution.
-
sersun over 12 yearsBalazs, this issue has been really bothering me and my clients, so I hope you find something and let me know. In the meantime, if this bandaid solution works for you, please upvote.
-
Balázs Németh over 12 yearsI more than sure this will help: facebook.stackoverflow.com/questions/7500745/…
-
Greg Ennis about 10 yearsYes... except if there are no faces to show, in which case the login button does appear! How to work around THAT?