|
|
|
|
- Special cases
- Managing subscriptions
inAppListPurchase (Function) In french: inAppListeAchat Returns the list: - of application products purchased by the user and not consumed.
- of active subscriptions for the user.
// 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
<Result> = inAppListPurchase(<Procedure> [, <Type of information>])
<Result>: Boolean - True if the request for retrieving the list of purchases was performed,
- False otherwise. To get more details on the error, use ErrorInfo.
<Procedure>: Character string Name of the WLanguage procedure ("callback") executed when the list of purchases is received. For more details on this procedure, see Parameters of the procedure used by inAppListPurchase. <Type of information>: Optional Integer constant Additional information that will be returned for each listed purchase (in addition to the product identifier): | | inAppAutoRenewal | - 1 if the subscription is automatically renewed at the next invoicing date.
- 0 if the subscription was canceled by the user or if the purchase does not correspond to a subscription.
| inAppOrderID | Number of the order corresponding to the purchase. | inAppPurchaseDate | Purchase date in YYYYMMDD format. For a subscription: purchase date of subscription. | inAppPurchaseID | Identifier of purchase. | inAppSubscriptionEndDate | End date of subscription in YYYYMMDD format. |
Remarks Special cases - When a product is consumed (inAppConsumeProduct), it is no longer displayed in the list returned by inAppListPurchase and it can be purchased again by the user (inAppPurchaseProduct).
- inAppListPurchase has no effect if it is run from the simulator or emulator.
Component: wd290android.aar
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|