I'm working on an Android/IPhone game. When a user beats one of their facebook's friends scores I want to notify that user by using the Facebook requests feature.
I'm trying to test by simply sending a message to myself for now.
I'm using the PHP SDK. Here is the code I'm using:
require_once("facebook.php");
$config = array();
$config['appId'] = 'xxx';
$config['secret'] = 'xxx';
$config['fileUpload'] = false; // optional
$facebook = new Facebook($config);
// $params["fb_sess"] is sent as a header
$facebook->setAccessToken($params["fb_sess"]);
$fbid = $facebook->getUser();
$req = array();
$req['message'] = "This is a test string";
$req['data'] = "this is the data string";
$req['ids'] = $fbid;
$result = $facebook->api("/apprequests","POST",$req);
echo "Result [";
print_r($result);
echo "]";
The result I get from the server is
(
[request] => 275812909174776
[to] => Array
(
[0] => 12818036
)
)
However, I don't see a notification on my facebook. I see it when I click on Apps and Games and then I see an Accept or X button... Since my game is mobile I don't want to have the accept or x button... I just want it to show up as a message to them.