Difference between revisions of "FBInstant.switchGameAsync"

From GiderosMobile
m (Text replacement - "</source>" to "</syntaxhighlight>")
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
 +
<languages />
 
'''<translate>Available since</translate>:''' Gideros 2018.3<br/>
 
'''<translate>Available since</translate>:''' Gideros 2018.3<br/>
 
'''<translate>Class</translate>:''' [[Special:MyLanguage/* Initialisation and Core|* Initialisation and Core]]<br/>
 
'''<translate>Class</translate>:''' [[Special:MyLanguage/* Initialisation and Core|* Initialisation and Core]]<br/>
Line 6: Line 7:
 
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 /></translate>
 
<br /></translate>
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
  FBInstant.switchGameAsync(appID,data,callback)
 
  FBInstant.switchGameAsync(appID,data,callback)
</source>
+
</syntaxhighlight>
 
=== <translate>Parameters</translate> ===
 
=== <translate>Parameters</translate> ===
 
'''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/>
 
'''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/>
Line 15: Line 16:
 
=== <translate>Examples</translate> ===
 
=== <translate>Examples</translate> ===
 
'''Example'''<br/>
 
'''Example'''<br/>
<source lang="lua">
+
<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/>