How to create requests dialog with multiple recipients selected by app

我们两清 提交于 2019-12-03 08:36:46

My guess is that you need to be whitelisted by Facebook to get this sort of super power. The Sims Social are using the same parameters as you do but have the ability to specify multiple recipients. You should ask Facebook to do the same for your app.

As per the Facebook documentation (which admittedly isn't very good), you can pass a JavaScript array, [], in the to attribute. It looks like uids is already an array, so try this:

FB.ui({
    method: 'apprequests',
    message: 'Send a gift',
    data: {},
    title: "Send a gift",
    to: uids
});

You can do this with the Requests Dialog - https://developers.facebook.com/docs/reference/dialogs/requests/

You can have up to 50 recipients per request (some restrictions on IE, as mentioned in the doc).

With multiple IDs, you can specify the recipients in the 'to' parameter as a JavaScript array, e.g. 'to: [1,2,3]'

According to the Improvements to Request 2.0 thread posted September 29, 2011

You can specify an array of user_ids in the ‘to’ field of the request dialog.

  function sendRequestToManyRecipients() {
    var user_ids = document.getElementsByName("user_ids")[0].value;
    FB.ui({method: 'apprequests',
      message: 'My Great Request',
      to: user_ids,
    }, requestCallback);
  }
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!