dongxian0320 2012-04-23 01:06
浏览 44

Facebook用户生成的应用程序请求/无摩擦请求

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.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 BP神经网络控制倒立摆
    • ¥20 要这个数学建模编程的代码 并且能完整允许出来结果 完整的过程和数据的结果
    • ¥15 html5+css和javascript有人可以帮吗?图片要怎么插入代码里面啊
    • ¥30 Unity接入微信SDK 无法开启摄像头
    • ¥20 有偿 写代码 要用特定的软件anaconda 里的jvpyter 用python3写
    • ¥20 cad图纸,chx-3六轴码垛机器人
    • ¥15 移动摄像头专网需要解vlan
    • ¥20 access多表提取相同字段数据并合并
    • ¥20 基于MSP430f5529的MPU6050驱动,求出欧拉角
    • ¥20 Java-Oj-桌布的计算