开发者

Invite friends, facebook application development, stuck at last stage, using php-sdk

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"]);
         }
?>


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/

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜