Phaser API Documentation

  Version: 
switchGame(appID, [data])

Description:

Request that the client switch to a different Instant Game.

It makes an async call to the API, so the result isn't available immediately.

If the game switches successfully this plugin will emit the switchgame event and the client will load the new game.

If they cannot, i.e. it's not in the list of supported APIs, or the request was rejected, it will emit a switchgamefail event instead.

Parameters:

name type arguments description
appID string

The Application ID of the Instant Game to switch to. The application must be an Instant Game, and must belong to the same business as the current game.

data object <optional>

An optional data payload. This will be set as the entrypoint data for the game being switched to. Must be less than or equal to 1000 characters when stringified.

Returns:
Description:

This Facebook Instant Games Plugin instance.

Examples:
Since: 3.13.0