开发者

Facebook Request Dialog for single person

I am making a simple turn based board game on facebook. I plan to make a multiplayer mode where two player can play together like a duel mode. To do that, a person can send an app request to another person using facebook request dialog. But the user can select more that one person in that dialog. How do I make it send the request to only one person?

I could send to only one person using the graph API. But then, I need to开发者_如何学C get the target person's facebook id. I couldnt just 'prompt("Give me the user's facebook id")' for it. What the user need is a dialog where the user can select one of his friends, and return the facebook id. Is there such dialog in facebook? Or I will just need to make one.


You need to make one yourself.

  1. Retrieve all friends through Graph API or FQL
  2. Let the user choose one of them
  3. Fire the Request Dialog with that specific friend's ID


i had the same question and landed here. I know that this is a old question but still people can and will find this.

So the right answer for me is:

FB.ui({method: 'apprequests',
message: 'My Great Request',
max_recipients : 1

}, requestCallback);

You can find this information at https://developers.facebook.com/docs/reference/dialogs/requests/

I hope I could help some developers

cheers.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜