Difference between revisions of "FBInstant.payments.getCatalogAsync"

From GiderosMobile
m (Text replacement - "<source" to "<syntaxhighlight")
Line 7: Line 7:
 
Fetches the game's product catalog.<br />
 
Fetches the game's product catalog.<br />
 
<br /></translate>
 
<br /></translate>
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
  FBInstant.payments.getCatalogAsync(callback)
 
  FBInstant.payments.getCatalogAsync(callback)
 
</source>
 
</source>
Line 14: Line 14:
 
=== <translate>Examples</translate> ===
 
=== <translate>Examples</translate> ===
 
'''Example 1'''<br/>
 
'''Example 1'''<br/>
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
FBInstant.payments.getCatalogAsync(function(result,error)
 
FBInstant.payments.getCatalogAsync(function(result,error)
 
     if result then
 
     if result then
Line 24: Line 24:
 
<br/></source>
 
<br/></source>
 
'''Example 2'''<br/>
 
'''Example 2'''<br/>
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
FBInstant.payments.getCatalogAsync(function(result,error)
 
FBInstant.payments.getCatalogAsync(function(result,error)
 
     if result then
 
     if result then

Revision as of 15:26, 13 July 2023


Available since: Gideros 2018.3
Class: Payments

Description


Fetches the game's product catalog.

<syntaxhighlight lang="lua">

FBInstant.payments.getCatalogAsync(callback)

</source>

Parameters

callback: (function) A function that will be called with two arguments: a set of key-value pairs that are the products that are registered to the game or nil if the operation failed, and an error code if the function failed.

Examples

Example 1
<syntaxhighlight lang="lua"> FBInstant.payments.getCatalogAsync(function(result,error)

   if result then

for key,value in pairs(result) do print(key,value) end end end)
</source> Example 2
<syntaxhighlight lang="lua"> FBInstant.payments.getCatalogAsync(function(result,error)

   if result then

for loop=1,#result do local p=result[loop] print("title,id,description,umage,price,currency",p.title,p.productID,p.description,p.imageURI,p.price,p.priceCurrencyCode) end end end)
</source>