Pergunta

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

Solução

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/

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top