Difference between revisions of "FBInstant.payments.getCatalogAsync"
From GiderosMobile
(Created page with "__NOTOC__ '''Available since:''' Gideros 2018.3<br/> === Description === <br /> Fetches the game's product catalog.<br /> <br /> <source lang="lua"> = FBInstant.payments.getCa...") |
m (Text replacement - "</source>" to "</syntaxhighlight>") |
||
(8 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/Payments|Payments]]<br/> |
+ | === <translate>Description</translate> === | ||
+ | <translate><br /> | ||
Fetches the game's product catalog.<br /> | Fetches the game's product catalog.<br /> | ||
− | <br /> | + | <br /></translate> |
− | < | + | <syntaxhighlight lang="lua"> |
− | + | FBInstant.payments.getCatalogAsync(callback) | |
− | </ | + | </syntaxhighlight> |
− | '''callback | + | === <translate>Parameters</translate> === |
+ | '''callback''': (function) <translate>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.</translate> <br/> | ||
+ | === <translate>Examples</translate> === | ||
+ | '''Example 1'''<br/> | ||
+ | <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) | ||
+ | <br/></syntaxhighlight> | ||
+ | '''Example 2'''<br/> | ||
+ | <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) | ||
+ | <br/></syntaxhighlight> | ||
+ | |||
+ | {{FBInstant.payments}} |
Latest revision as of 14:27, 13 July 2023
Available since: Gideros 2018.3
Class: Payments
Description
Fetches the game's product catalog.
FBInstant.payments.getCatalogAsync(callback)
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
FBInstant.payments.getCatalogAsync(function(result,error)
if result then
for key,value in pairs(result) do
print(key,value)
end
end
end)
<br/>
Example 2
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)
<br/>