-
Notifications
You must be signed in to change notification settings - Fork 21
7. Game Requests
Thomas Pronold edited this page Jan 9, 2016
·
9 revisions
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.
There is also a example libGDX project which shows the usage of gdx-facebook: https://github.com/TomGrill/gdx-facebook-app