|
|
|
|
WLanguage procedure called by inAppListPurchase Procedure ("Callback") called by inAppListPurchase when the list of purchases made is received. This procedure can be a local, global or internal procedure. // Retrieve the list of purchases for the user inAppListPurchase(ListPurchase, inAppPurchaseID) PROCÉDURE ListPurchase(bSuccess is boolean, sPurchaseList is string) IF NOT bSuccess THEN ToastDisplay(ErrorInfo()) ELSE // Browses the purchases performed FOR EACH STRING sPurchaseInfo OF sPurchaseList SEPARATED BY CR // Retrieves the product identifier sProductID is string = ExtractString(sPurchaseInfo, 1, TAB) // Retrieves the purchase identifier sPurchaseID is string = ExtractString(sPurchaseInfo, 2, TAB) // Consumes the product if necessary IF sProductID = "PRODUCT_ID" THEN inAppConsumeProduct(sProductID, ConsumeProduct) END END END END PROCÉDURE ConsumeProduct(nSuccess is boolean) IF NOT bSuccess THEN ToastDisplay(ErrorInfo()) ELSE // Consume the product in the application ... END END Syntax
inAppListPurchase_Callback(<Success> , <PurchaseList>)
<Success>: Boolean - True if the list of purchases performed by the user was retrieved,
- False otherwise. To get more details on the error, use ErrorInfo before any other call to a WLanguage function (this would reinitialize the error).
<PurchaseList>: Character string Details of each purchase made by the user. The information returned for each purchase has the following format (according to the requested information):
<Product identifier> + TAB + <Order number> + TAB + <Purchase date> + TAB + <Purchase identifier> + TAB + <Automatic renewal> + TAB + <End date of subscription> If several purchases are listed, they are separated by CR characters (Carriage Return).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|