开发者

Facebook App Don't Work Inside Pages

I have a facebook application which was programmed about a year ago. I changed the settings a bit, and now i can't make it work inside a facebook page... it always shows me a facebook logo instead of the app, and when it is working outside of the page, it appears to be working...

I opened another facebook app to check if the code is fine, and it is.

(its not the secret a开发者_如何学运维nd appid)

What should i do?


The problem is that Facebook doesn't allow Facebook in itself. This happens because you're probably using PHP to redirect the user to the login / ask permissions page (php redirects iframe content, not the parent page the user is on).

So here's a workaround using little Javascript.

$location = $facebook->getLoginUrl();
print '<script language="javascript" type="text/javascript"> top.location.href="'. $location .'"; </script>';

NB! Using the old PHP SDK is not advised. Please consider upgrading to the latest version.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜