Difference between revisions of "FBInstant.context.chooseAsync"

From GiderosMobile
(Created page with "__NOTOC__ '''Available since:''' Gideros 2018.3<br/> === Description === <br /> Opens a context selection dialog for the player. If the player selects an available context, th...")
 
Line 6: Line 6:
 
<br />
 
<br />
 
<source lang="lua">
 
<source lang="lua">
= FBInstant.context.chooseAsync(optionscallback,)
+
FBInstant.context.chooseAsync(options,callback)
 
</source>
 
</source>
'''options:''' (table) A table specifying conditions on the contexts that should be offered. '''optional'''<br/>
+
'''options''': (table) A table specifying conditions on the contexts that should be offered. '''optional'''<br/>
'''callback:''' (function) A function that will be called with two arguments: true when the game has switched into the context chosen by the user. Otherwise, the promise will reject (if the user cancels out of the dialog, for example) and an error code if the function failed. ''''''<br/>
+
'''callback''': (function) A function that will be called with two arguments: true when the game has switched into the context chosen by the user. Otherwise, the promise will reject (if the user cancels out of the dialog, for example) and an error code if the function failed. ''''''<br/>

Revision as of 10:21, 23 August 2018

Available since: Gideros 2018.3

Description


Opens a context selection dialog for the player. If the player selects an available context, the client will attempt to switch into that context, and resolve if successful. Otherwise, if the player exits the menu or the client fails to switch into the new context, this function will reject.

 FBInstant.context.chooseAsync(options,callback)

options: (table) A table specifying conditions on the contexts that should be offered. optional
'callback: (function) A function that will be called with two arguments: true when the game has switched into the context chosen by the user. Otherwise, the promise will reject (if the user cancels out of the dialog, for example) and an error code if the function failed. '