How to create a query dialog with multiple recipients selected by the application

Sims Social has its own selector. And as soon as you select your friends and click "Submit", he will bring up this official dialogue with the Facebook request, in which there are several friends, and the checkbox "Do not ask before sending Sims Social requests to ..."

How can I duplicate this? I tried to send the array to the apprequests ui dialog, but this gives an error message: too many recipients.

image

I do not use the Facebook friends selector. I use my own and send them to the apprequests dialog. Sims do it, I just can't play it.

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

I tried the box with the string list "1234,4567". I tried it with an array of {1234, 4567}. But no one is working. An array with a single UID works fine. But several UIDs give an error message: too many recipients.

+4
source share
4 answers

I guess you need to be on Facebook to get such super power. Sims Social uses the same parameters as you, but has the ability to specify multiple recipients. You should ask Facebook to do the same for your application.

+1
source

According to the Facebook documentation (which admittedly is not very good), you can pass an array of JavaScript, [] , to . It seems that uids already an array, so try the following:

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

You can do this using the query dialog - https://developers.facebook.com/docs/reference/dialogs/requests/

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

With multiple identifiers, you can specify recipients in the 'to' parameter as an array of JavaScript, for example. 'to: [1,2,3]'

+1
source

According to Improvements for Request 2.0, the thread was published on September 29, 2011.

You can specify the user_id array in the "for the query field" dialog box.

  function sendRequestToManyRecipients() { var user_ids = document.getElementsByName("user_ids")[0].value; FB.ui({method: 'apprequests', message: 'My Great Request', to: user_ids, }, requestCallback); } 
0
source

Source: https://habr.com/ru/post/1369597/


All Articles