FBInstant.switchGameAsync

From GiderosMobile
Revision as of 09:28, 24 August 2018 by Hgy29 (talk | contribs)

Available since: Gideros 2018.3
Class: * Initialisation and Core

Description


Request that the client switch to a different Instant Game. The API will reject if the switch fails - else, the client will load the new game.

 FBInstant.switchGameAsync(appID,data,callback)

Parameters

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. To associate different games with the same business, you can use Business Manager: https://developers.facebook.com/docs/apps/business-manager#update-business.
data: (string) 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. optional
callback: (function) A function that will be called with one argument: An error code if the function failed.

Examples

Example

FBInstant.switchGameAsync("12345678",nil, function(error)
	print("Handle game change failure")
end)
<br/>