我有iframe应用程序的严重问题。我需要使用许多外部JS库和其他动态stuuf,因此FMBL应用程序无法完成。当我调用require_login()时,当应用程序尚未安装时,我得到了应用程序安装对话框,这没关系。但是,然后在授权应用程序进入无尽的重定向循环,如auth_token,安装等参数。昨天我设法解决了这个问题,但今天它又被打破了...... FB发生了什么事情?这让我疯狂找到一种溶剂,在网上发现的任何一种都没有效果。Facebook的require_login()在iFrame应用程序
到目前为止,我尝试:
http://abhirama.wordpress.com/2010/03/07/facebook-iframe-xfbml-app/(!2010年3月7日) http://forum.developers.facebook.com/viewtopic.php?pid=156092 http://www.keywordintellect.com/facebook-development/how-to-set-up-a-facebook-iframe-application-in-php-in-5-minutes/
http://www.markdeepwell.com/2010/02/validating-a-facebook-session-within-an-iframe/ http://forum.developers.facebook.com/viewtopic.php?pid=210449 http://www.ajaxlines.com/ajax/stuff/article/facebook_fbml_rendering_in_iframe_application.php http://www.aratide.com/php/solving-the-break-out-issue-in-iframe-facebook-applications/
无上述工作......根据这些和一些FB文档: http://wiki.developers.facebook.com/index.php/FB_RequireFeatures http://wiki.developers.facebook.com/index.php/Cross_Domain_Communication_Channel
我的示例测试文件看起来如下:
<?php
//Link in library.
require_once '../application/vendor/Facebook/facebook.php';
//Authentication Keys
$appapikey = 'XXXX';
$appsecret = 'XXXX';
//Construct the class
$facebook = new Facebook($appapikey, $appsecret);
//Require login
$user_id = $facebook->require_login();
?>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
<title></title>
</head>
<body>
<script src="http://static.ak.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php" type="text/javascript"></script>
This is you: <fb:name uid="<?php echo $user_id?>"></fb:name>
<?php var_dump($facebook->$this->facebook->api_client->friends_get())?>
<script type="text/javascript">
FB_RequireFeatures(["XFBML"], function(){
FB.Facebook.init("<?=$appapikey?>", "xd_receiver.html");
});
</script>
</body>
</html>
和跨域文件xd_receiver.html是:
<!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>cross-domain receiver page</title>
</head>
<body>
<script src="http://static.ak.facebook.com/js/api_lib/v0.4/XdCommReceiver.js" type="text/javascript"></script>
</body>
</html>
我如何得到它的工作?
我正在使用Kohana框架来做到这一点,并已在facebook php库中用url :: redirect()替换了header('Location')。
这是一个iframe应用程序。我尝试在iframe中调用require_login,并将我的服务器上的Facebook外部重定向到应用程序,并以URI中auth_token变量的无限循环结束。我也尝试了FBML应用程序,并使用将iframe放入画布中,但流程相同。 –
2010-04-04 10:08:28