ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Mobile specific functions / In-App Purchase functions
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
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.
Example
// 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).
Minimum version required
  • Version 25
Comments
Click [Add] to post a comment

Last update: 06/30/2023

Send a report | Local help