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.
- Retrieve all friends through Graph API or FQL
- Let the user choose one of them
- 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.
精彩评论