Difference between revisions of "FBInstant.switchGameAsync"

From GiderosMobile
m (Text replacement - "</source>" to "</syntaxhighlight>")
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
'''Available since:''' Gideros 2018.3<br/>
+
<languages />
=== Description ===
+
'''<translate>Available since</translate>:''' Gideros 2018.3<br/>
<br />
+
'''<translate>Class</translate>:''' [[Special:MyLanguage/* Initialisation and Core|* Initialisation and Core]]<br/>
 +
=== <translate>Description</translate> ===
 +
<translate><br />
 
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.<br />
 
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.<br />
<br />
+
<br /></translate>
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
  FBInstant.switchGameAsync(appID,data,callback)
 
  FBInstant.switchGameAsync(appID,data,callback)
</source>
+
</syntaxhighlight>
=== Parameters ===
+
=== <translate>Parameters</translate> ===
'''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. <br/>
+
'''appID''': (string) <translate>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.</translate> <br/>
'''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'''<br/>
+
'''data''': (string) <translate>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.</translate> '''optional'''<br/>
'''callback''': (function) A function that will be called with one argument: An error code if the function failed. <br/>
+
'''callback''': (function) <translate>A function that will be called with one argument: An error code if the function failed.</translate> <br/>
=== Examples ===
+
=== <translate>Examples</translate> ===
 
'''Example'''<br/>
 
'''Example'''<br/>
<source lang="lua"><br />
+
<syntaxhighlight lang="lua">
 
FBInstant.switchGameAsync("12345678",nil, function(error)
 
FBInstant.switchGameAsync("12345678",nil, function(error)
 
print("Handle game change failure")
 
print("Handle game change failure")
 
end)
 
end)
<br/></source>
+
<br/></syntaxhighlight>
 +
 
 +
{{FBInstant}}

Latest revision as of 14:29, 13 July 2023


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/>