Turn-Based Games

Unforchinalty Facebook does not provide rich turn-based matchmaking API like Game Center(IOS) or Play Service(Android). Which mean developer should implement turn-based matchmaking logic by himself or use another 3-rd party solutions. However, turn-based games can use requests to great effect as a notification mechanism. When one player completes a turn they can send a request to their opponent prompting them to take their turn. This helps to keep players engaged with the game.

Turn based game sending a `turn` request


Turn based game using `turn` request to notify a player it's their turn.


Following code snippet shows how to send turn notification.  By default, the sender is presented with a multi-friend selector allowing them to select a maximum of 50 recipients.

SPFacebook.instance.SendTrunRequest("Smaple title", "Smaple Message");


Sending requests to a specific recipient and providing additional request data:

Note: If the to field is specified, the sender will not be able to select additional recipients.

string FriendId = "1405568046403868";
		SPFacebook.instance.SendTrunRequest("Sample Titile", "Sample message", "some_request_dara", new string[]{FriendId});


The other request handling part is the same as for the Game Gifting API and described here:


You can read more about the Facebook App requests at the Facebook Official Documentation. The implementation example can be found at the FacebookTurnBasedAndGifts example scene.