FetchAppProducts()
Syntax
FetchAppProducts(Callback)Description
Fetch information from the store about all previously registered products with RegisterAppProduct().
Parameters
Callback A callback which will be called when the fetch is finished. It has to respect the following declaration: Procedure OnFetchAppProducts(Success) ; Success will be #True if fetch has been successful, or #False if it failed. EndProcedure
Return value
None.
Example
Procedure OnFetchAppProducts(Success)
If Success
If ExamineAppProducts()
While NextAppProduct()
Debug "id: " + AppProductId() + ", name: " + AppProductName() + ", price: " + AppProductPrice()
Wend
Else
Debug "ExamineAppProducts() failed."
EndIf
Else
Debug "FetchAppProducts() failed."
EndIf
EndProcedure
Procedure OnPurchaseAppProduct(State, ProductId$)
Debug "Product: " + ProductId$ + ", state : " + State
EndProcedure
RegisterAppProduct("gems", @OnPurchaseAppProduct()) ; can be purchased more than once
RegisterAppProduct("helmet", @OnPurchaseAppProduct(), #PB_Product_NonConsumable) ; can be purchased only once
FetchAppProducts(@OnFetchAppProducts())
See Also
RegisterAppProduct()
Supported OS
Android, iOS