7. Game Requests - TomGrill/gdx-facebook GitHub Wiki

Game Requests

Only available in Android and iOS

Read more at: https://developers.facebook.com/docs/games/requests/

Note: Frictionless request are not yet supported


GDXFacebookGameRequest request = new GDXFacebookGameRequest();
request.setMessage("Come on play this game with me!");
gdxFacebook.showGameRequest(request, new GDXFacebookCallback<GameRequestResult>() {

	@Override
	public void onSuccess(GameRequestResult result) {
		System.out.println(result.getRequestId());	// The ID of the request
		System.out.println(result.getRecipients());	// list of user ids who got the game requests
	}

	@Override
	public void onError(GDXFacebookError error) {
		// handle error

	}

	@Override
	public void onFail(Throwable t) {
		// does not happen when doing game requests

	}

	@Override
	public void onCancel() {
		// handle cancel

	}
});

The GDXFacebookGameRequest class has a lot of methods to specifiy your game request.