Invite other users to play a game
showInvitationBox(invitation)

🚧

Note

This feature will not function unless we have enabled it for your game. If you would like to have this feature enabled, please email us at [email protected].

Invite Friends

This feature displays a dialog requesting the player send a Private Message to their friends inviting them to try your game. If the player is not authenticated, it will require the player to authenticate before displaying the dialog.

The Private Message includes a game specific message you provide and some text the player may enter in the dialog. The dialog includes an interface for selecting up to 20 friends and other Kongregate members to invite and a Text Field to edit a message. An optional filter parameter may be used to narrow the list of invitees to those that have or have not played the game.

NameTypeDescription
invitationObjectAn object containing fields describing the invitation

The invitation object can contain the following fields:

NameTypeDescription
contentStringThe text content of the invitation
filterStringOptional parameter. If set to played, the dialog will only allow the player to select users that have played the game. When set to not_played, the dialog will only the player to select users that have never played the game. You can also pass a list of user IDs as the filter, and it will only show those users ex "123 8219". When left blank, all users will be available to invite.
kv_paramsObjectAn optional object containing parameters to be included in the game link. They must all be prepended with kv_ to be passed through to the game

Example Simple invitation:

kongregate.services.showInvitationBox({
  content: "Come try out this awesome game!"
});
kongregate.services.showInvitationBox({
  content: "Come try out this awesome game!"
});

Example Only invite players who have never played:

kongregate.services.showInvitationBox({
  content: "Come try out this awesome game!",
  filter: "not_played",
  kv_params: { kv_promo_code: 12345 }
});
kongregate.services.showInvitationBox({
  content: "Come try out this awesome game!",
  filter: "not_played",
  kv_params: { kv_promo_code: 12345 }
});