0

I'm trying to send an app to user request in facebook. Here are my codes:

<?php
        include 'connect.php';
        $param = array(
           'message'      => 'Check out the latest update',
           'data'         => 'some_data_string',
           'access_token' => $facebook->getAccessToken(),
        );
        $tmp = $facebook->api("/100001160043714/apprequests", "POST", $param);
        print_r($tmp)
?>

I'm getting this result on the last line printing:

Array ( [request] => 364366050304238 [to] => Array ( [0] => 100001160043714 ) )

The specified user id is my own account. However, I'm not getting any request. Is there any permission to enable?

Noor
  • 19,638
  • 38
  • 136
  • 254
  • The fact that you are getting back a request_id shows that the invite is indeed being sent. Is you application in sand box mode? – Lix Sep 16 '12 at 09:24
  • what you do mean by sandbox mode? it is a canvas application. You can check it at https://apps.facebook.com/moribay. – Noor Sep 16 '12 at 09:26
  • 1
    If your application is in [sandbox mode](https://developers.facebook.com/docs/ApplicationSecurity/), your actions within the application will be hidden to anyone not listed in the "roles" of the application as a developer/tester/admin... etc.. Check your application settings.. – Lix Sep 16 '12 at 09:27
  • I'm myself the admin, so at least me should have seen it – Noor Sep 16 '12 at 09:29
  • have you tried to send the request to someone other than the admin? – Lix Sep 16 '12 at 09:36
  • Unfortunately, still not working even though i sent it to another account, do you think its a permission problem?? – Noor Sep 16 '12 at 10:45
  • No. Permissions have nothing to do with this. As you can see the request **is** being sent. Have you set your `canvas_url` property in your app settings? – Lix Sep 16 '12 at 10:49
  • if the application is loading correctly, then I think we can assume that the canvas url is correct. Am i right? – Noor Sep 16 '12 at 11:07
  • 1
    Assumptions and presumptions lead to problems :P Check the setting. If your app is a tab application, you might not *need* to set the canvas url. But for the requests to work you are required to fill this field. – Lix Sep 16 '12 at 11:08
  • yeps, the URL is ok, it's https://fbapps-noor.rhcloud.com/moribay/index.php?id= – Noor Sep 16 '12 at 13:25
  • Ok, it works, but it doesn't show anything that inform the user that they have obtained a request, no notifs nothing – Noor Sep 16 '12 at 15:22
  • @Noor - Does the user see the request on facebook.com/reqs.php? – Claudiu Sep 19 '12 at 13:57

0 Answers0