我有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