邀请好友,facebook应用开发,卡在最后阶段,使用php-sdk

发布于 2024-10-22 11:47:30 字数 787 浏览 1 评论 0原文

我正在尝试开发一个facebook应用程序,最后一步尚未完成,即邀请朋友玩该应用程序。我尝试以下代码,但出现错误。请建议如何进行。谢谢!

从index.php我调用invite.php,其编写如下,我已经能够在用户墙上发表评论。

invite.php
<?php 

         $app_id = '************';

         $canvas_page = '127.0.0.1/****/';    
         $message = "Would you like to join me in this great app?";

         $requests_url = "http://www.facebook.com/dialog/apprequests?app_id=" 
                . $app_id . "&redirect_uri=" . urlencode($canvas_page)
                . "&message=" . $message;

         if (empty($_REQUEST["request_ids"])) {
            echo("<script> top.location.href='" . $requests_url . "'</script>");
         } else {
            echo "Request Ids: ";
            print_r($_REQUEST["request_ids"]);
         }
?>

I am trying to develop a facebook application, the last step is unfinished, that of inviting friends to play the app. i try the following code, but i am getting error. Please suggest how to go about. Thanks!

From index.php i am calling invite.php which is written as follows, i am already able to post comments on user's wall.

invite.php
<?php 

         $app_id = '************';

         $canvas_page = '127.0.0.1/****/';    
         $message = "Would you like to join me in this great app?";

         $requests_url = "http://www.facebook.com/dialog/apprequests?app_id=" 
                . $app_id . "&redirect_uri=" . urlencode($canvas_page)
                . "&message=" . $message;

         if (empty($_REQUEST["request_ids"])) {
            echo("<script> top.location.href='" . $requests_url . "'</script>");
         } else {
            echo "Request Ids: ";
            print_r($_REQUEST["request_ids"]);
         }
?>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

我一向站在原地 2024-10-29 11:47:30

我发现使用最近发布的请求对话框更容易。它使用 javascript SDK,而不是 OpenGraph URL 方法。

http://developers.facebook.com/docs/reference/dialogs/requests/

I found it easier to just use the request dialog, which was recently released. It uses the javascript SDK, not the OpenGraph URL method.

http://developers.facebook.com/docs/reference/dialogs/requests/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文