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?
Related
I have been adding facebook like button code on all the pages of my website www.fitgunler.com since a year. For the last 2 weeks, I cannot seem to get a code for the like button. As I have always done before, I go to the https://developers.facebook.com/docs/plugins/like-button/ page, enter my URL and click get code. However first "Not logged in, please log in to continue" box appears, then I click log in (by the way I am already logged in on another tab while I am doing this) and then it goes to the same initial page, I enter the URL and click get code and again the same login box appears.
I cannot reproduce your problem. Are you sure you're logged in? Can you see your facebook-profile at the top of that page to generate the code? It seems that your session cannot be created.
You should not be logged in on another tab to be sure that facebook does not confuse with two logins.
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 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/
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.