0

帮助我用我正在通过我的设备从我的应用程序更新的状态标记多个朋友。这就是我正在做的

var data = {
    link : "http://www.appcelerator.com",
    name : "Appcelerator Titanium (iteration " + iter + ")",
    tags : ("1234","5678"),



    accesstoken : "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",

    message : "Awesome SDKs for building desktop and mobile apps  ",
    place : "XXXXXXXX",

    caption : "Appcelerator Titanium (iteration " + iter + ")",
    picture : "http://developer.appcelerator.com/assets/img/DEV_titmobile_image.png",

    description : "You've got the ideas, now you've got the power. Titanium translates your hard won web skills..."
};
fb.requestWithGraphPath('me/feed', data, 'POST', showRequestResult);

当我运行这个时,只有上面提到的 id 为“5678”的第二个用户被标记,而不是第一个用户。我还尝试了其他方法,例如,

tags1 : {
        'tags' : [{
            "id" : "12345"

        }, {
            "id" : "12345"

        }, {
            "id" : "56789"

        }, {
            "id" : "457889"

        }, {
            "id" : "567890"

        }, {
            "id" : "987654"

        }, {
            "id" : "98765"

        }]
    },

我收到一个错误,因为 (#100) 参数标签必须是一个数组

我也试过这个方法

var idnos = [];
idNos[0] = "123456";
idNos[1] = "4567";
idNos[2] = "456788";
idNos[3] = "45678989";
idNos[4] = "987654";
idNos[5] = "4567889";

tags = idnos
4

1 回答 1

0

标签字段的参数应该是一个数组。所以代替这个:

var data = {
    link : "http://www.appcelerator.com",
    name : "Appcelerator Titanium (iteration " + iter + ")",
    tags : ("1234","5678"),



    accesstoken : "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",

    message : "Awesome SDKs for building desktop and mobile apps  ",
    place : "XXXXXXXX",

    caption : "Appcelerator Titanium (iteration " + iter + ")",
    picture : "http://developer.appcelerator.com/assets/img/DEV_titmobile_image.png",

    description : "You've got the ideas, now you've got the power. Titanium translates your hard won web skills..."
};

利用:

var data = {
    link : "http://www.appcelerator.com",
    name : "Appcelerator Titanium (iteration " + iter + ")",
    tags : [{ "tag_uid":"1234" },{ "tag_uid":"5678" }],



    accesstoken : "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",

    message : "Awesome SDKs for building desktop and mobile apps  ",
    place : "XXXXXXXX",

    caption : "Appcelerator Titanium (iteration " + iter + ")",
    picture : "http://developer.appcelerator.com/assets/img/DEV_titmobile_image.png",

    description : "You've got the ideas, now you've got the power. Titanium translates your hard won web skills..."
};
于 2013-08-02T19:47:50.150 回答