I am using Facebook Javascript API on one of my websites and is displaying login button using the following code :
<div class = 'connect_fb'>
<fb:login-button autologoutlink="true" perms="email,user_birthday,status_update,publish_stream"></fb:login-button>
</div>
It was working fine until today. But now I have observed some changes.
The login button became small as compared to the older one.
The login box it is showing is different.
There is no logout option after logging in using Facebook.
Immediately after logged out, it is not showing the login button again and the Facebook session still exist. Until today , it will logout the user from Facebook System and login button is showed up.
Anyone is experiencing such an issue..? Is there any possibility that the XFBML I have used has been deprecated ..?
You can see the issue here in my website.
http://bit.ly/H1hAZE
As far i can remember they deprecated the xFBML tag for login & logout , have a look here
https://developers.facebook.com/docs/reference/javascript/
Related
I started using a custom facebook login button by calling FB.login and it works ok when tested it with a browser already logged into facebook (it asks for the permissions) except that the popup does not close after its work is done, I end up with a blank popup with this url https://www.facebook.com/dialog/oauth/extended
This is happening on firefox and chrome, didn't try others yet.
When tested with a browser not already logged into facebook I get the same sort of problem after the sign in page - blank popup and no prompts for permissions.
Is there an event I have to catch that the SDK would catch for me if I did not use a custom button?
Is there a good guide to using a custom button for facebook login or is it not allowed? I'm guessin the lack of the usual facebook elements ( fb:login-button... div class="fb-login-button") on my page are throwing off the SDK. Do I need to skip the SDK just to have a custom button?
Thanks.
ok, sorry. I was looking deep into facebook apis when the problem was that in my button's onclick I forgot to return false, so the button click reloaded the page and that broke stuff I guess by invalidating various facebook api internal references. Just changing onclick function to return false fixed my problem. see code for new line:
$("#linkfacebook").click(function() {
FB.login(function(response) {}, {scope: 'publish_stream,manage_pages'});
return false; // this is the new line that fixed the problem
});
I have a facebook XFBML activity tab, using the usual <fb:activity ...></fb:activity>; the code comes straight from https://developers.facebook.com/docs/reference/plugins/activity/.
If the user is logged into facebook when the page is loaded, it works fine.
If the user is not logged in initially, the box is blank (fair enough). When he presses the login button on my page to log into facebook and sign up for my app, I attempt to refresh the activity plugin using the function:
FB.XFBML.parse();
(see http://developers.facebook.com/docs/reference/javascript/FB.XFBML.parse/)
After 30 seconds, however, this fails, leaving the activity box blank and giving the following error on the console:
1 XFBML tags failed to render in 30000ms
Does anyone have any ideas why this might be?
My site has the option of registering with and without facebook. When you register with facebook though, extra information is needed. This is fine, as I use fb:registration and specify extra fields.
However, the problem is, when a user comes to the site and hasn't registered, sees the facebook login button and clicks it, the link brings them to facebook to login and the app is registered and bypasses the registration form I have.
I there a way to redirect a non-registered user that is not logged in with facebook to a registration page instead of adding the app?
You can add the registration-url parameter to the login button as documented in the Login + Registration Flows section.
<fb:login-button
registration-url="yoururl" />
This isn't documented so I don't know if it will continue to work but if your using the HTML5 version of the login button then you can use:
<div class="fb-login-button" data-registration-url="yoururl">Login with Facebook</div>
Not 100% sure i understood you but..
Going on the assumption that you only want users who have an active FB browser session and have authorized the use of your application with their account to see your login button/a particular page you could try this right after your FB.init:
FB.getLoginStatus(function(response) {
if(notLoggedIntoYourSite && response.status != 'connected') {
// Redirect user or hide login button
}
})
Ref: http://developers.facebook.com/docs/reference/javascript/FB.getLoginStatus/
I use below method to Authenticate..
https://www.facebook.com/dialog/oauth?client_id=&redirect_uri=&scope=email,user_birthday,status_update,publish_stream,read_stream,user_about_me,offline_access,user_likes&response_type=code&display=page
2 Problem is that instead of Showing Permission Page facebook showing its own Button then when i cick on that button it showing Pemission Page...
FYI When i hit this link directly to browser it is working fine. But through my website it is as above.
How to avoid this button to appear and directly show permission page to user..
It was Bug from facebook..
Now it is working fine..
On my page I have the FB login button code. A user is able to join my site by authorizing it with Facebook, by pressing the FB login button. My site lets users log out and many of them like to do that.
After I authorize my FB account for the site, log out of my site, I can't login any more because the session event never fires (unless I de-authorize it). I press the FB Login button a white page opens, then closes right away, and nothing happens. This seems to be because the FB session doesn't change (it already existed) so the event is never fired. So I'm wondering if there's a way around this aside from hiding FB's login button and making my own if their session exists. I tried "auth.login" but that doesn't fire either.
Button:
<fb:login-button perms="email,user_about_me,user_birthday">Login with Facebook</fb:login-button>
Event:
FB.Event.subscribe('auth.sessionChange', function (response) {
document.location.href = "/FacebookLogin.aspx";
});
Steps to reproduce:
Click FB login and authorize app (in this case my site). User is redirected to my FB login page and an account on my site is created. The user is now logged into my site.
Logout of my site using my sites logout button
Click the FB login button to log back into site. This is where the user should be redirected back to that same page from step 1 so they can be logged into the site.
All that happens in step 3 is a white page pops up for a couple seconds and then closes. The site is already authorized and the session event isn't fired.
This also happens if I authorize with one browser and then go back with a different browser. Just get the popup, it closes and nothing happens. I must be missing something important.
I had the same problem but, after a while, i solved it doing this:
function after_login_button(){
FB.getLoginStatus(function(response) {
if (response.status=="connected") {
//User logged in! Do your code here
}
}, true);
}
You also need to call the onlogin event on the login-button:
<fb:login-button onlogin="after_login_button()" perms="email,user_about_me,user_birthday">Login with Facebook</fb:login-button>
This worked for me =).
PS - By the way, I'm using OAuth 2.0 and you should migrate your application to it too because in the developers zone, they say:
"Remember that all apps must migrate to OAuth 2.0 by October 1".
Sorry for eventual english errors =S
Please make sure that you are doing FB.Event.subscribe within
window.fbAsyncInit = function() {
FB.init({
......
)};
FB.Event.subscribe('auth.login', function(response){
.....
)};
};
I had the same problem. After I put it inside the fbAsyncInit, it started accepting the events "auth.login"..
Hope this will work for you.