First I subscribe to auth.authResponseChange
and auth.statusChange
.
My Init call looks like this:
FB.init({
appId : app_id,
status : true,
cookie : true,
channelUrl : 'http://domain.com/channel.html',
frictionlessRequests:true,
xfbml : false
});
When logged in as a user it works fine.
However, when logged in as a page auth.authResponseChange
and auth.statusChange
are never called. I also tried setting status: false
and calling FB.getLoginStatus(callback_function)
but the callback function is never called.
I'm pretty sure this is a bug, but is there a workaround??
Also worth mentioning -- I get the following error in the console:
Refused to display document because display forbidden by X-Frame-Options.
I added the header X-Frame-Options: GOFORIT
to my page but the error remains.
The following SO questions are related but the answers do not really help:
- FB.INIT not forcing login even with status:true js sdk
- Refused to display document because display forbidden by X-Frame-Options
- How to Detect User logged as Page, FB.getLoginStatus doesn't work?
The last link above says to call FB.login() which will automatically warn the user if they are logged in as a page. However, calling login() is exactly what I'm trying to avoid doing.
Added Later: Facebook thinks that this bug has been fixed.