Difference between revisions of "FBInstant.switchGameAsync"

From GiderosMobile
(Created page with "__NOTOC__ '''Available since:''' Gideros 2018.3<br/> === Description === <br /> Request that the client switch to a different Instant Game. The API will reject if the switch f...")
 
Line 6: Line 6:
 
<br />
 
<br />
 
<source lang="lua">
 
<source lang="lua">
= FBInstant.switchGameAsync(appIDdatacallback,)
+
FBInstant.switchGameAsync(appID,data,callback)
 
</source>
 
</source>
'''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) 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/>
'''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) 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/>
'''callback:''' (function) A function that will be called with one argument: An error code if the function failed. ''''''<br/>
+
'''callback''': (function) A function that will be called with one argument: An error code if the function failed. ''''''<br/>

Revision as of 11:19, 23 August 2018

Available since: Gideros 2018.3

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)

'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. '