PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Special cases
  • Managing subscriptions
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Returns the list:
  • of application products purchased by the user and not consumed.
  • Versions 23 and later
    of active subscriptions for the user.
    New in version 23
    of active subscriptions for the user.
    of active subscriptions for the user.
Versions 23 and later
iPhone/iPad This function is now available for the iPhone/iPad applications.
New in version 23
iPhone/iPad This function is now available for the iPhone/iPad applications.
iPhone/iPad This function is now available for the iPhone/iPad applications.
Example
// Retrieve the list of purchases for the user
inAppListPurchase(ListPurchase, inAppPurchaseId)
PROCEDURE 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
PROCEDURE 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 find out the error details, use ErrorInfo.
<Procedure>: Character string (with or without quotes)
Name of WLanguage procedure ("callback" procedure) run when receiving the list of purchases performed. This procedure has the following format:
PROCEDURE <ProcedureName>(<Success> is boolean, <ListPurchase> is string)
where:
  • <Success> is boolean:
    • True if the list of purchases performed by the user was retrieved,
    • False otherwise. To retrieve the error details, use ErrorInfo before any other call to a WLanguage function (that would reinitialize the error).
  • <ListPurchase> is a character string containing information about each one of the purchases performed 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).
<Type of Information>: Optional Integer constant
Additional information that will be returned for each listed purchase (in addition to the product identifier):
inAppPurchaseDatePurchase date in YYYYMMDD format.
Versions 23 and later
For a subscription: purchase date of subscription.
New in version 23
For a subscription: purchase date of subscription.
For a subscription: purchase date of subscription.
Versions 23 and later
inAppSubscriptionEndDate
New in version 23
inAppSubscriptionEndDate
inAppSubscriptionEndDate
End date of subscription in YYYYMMDD format.
Android Information not available. Always corresponds to empty string ("").
If the subscription was canceled by the user, this subscription will be listed by inAppListPurchase until the next invoicing date and the access to the subscription will be lost at this time (see Managing subscriptions).
inAppPurchaseIdIdentifier of purchase.
Android This identifier is used in inAppConsumeProduct to consume a product that was purchased.
Versions 23 and later
iPhone/iPad This identifier has the same value as the one obtained with the inAppOrderId constant.
New in version 23
iPhone/iPad This identifier has the same value as the one obtained with the inAppOrderId constant.
iPhone/iPad This identifier has the same value as the one obtained with the inAppOrderId constant.
inAppOrderIdNumber of the order corresponding to the purchase.
Versions 23 and later
inAppAutoRenewal
New in version 23
inAppAutoRenewal
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.
iPhone/iPad Information not available. Always corresponds to 0.
Remarks

Special cases

  • Android 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.
  • inAppListPurchase is available on the devices running Android version 2.2 or later (api level 8).
    A fatal error will occur if the function is used with an earlier system version.
    To find out the version of Android system on which the application is run, use SysAndroidVersion.
  • iPhone/iPad At consumable product is always consumed when it is purchased and therefore if will never appear in the result of inAppListPurchase.
Versions 23 and later

Managing subscriptions

Android In Android:
  • If a subscription is listed by inAppListPurchase, the user must be able to access the subscription content.
  • If the subscription was canceled by the user, this subscription will be listed by inAppListPurchase until the next invoicing date and the access to the subscription will be lost at this time. You can allow the user to renew his subscription from the application (inAppPurchaseProduct).
iPhone/iPad In iOS:
  • The subscription is valid between the purchase date and the end date of subscription.
  • An expired subscription can be returned by inAppListPurchase. It is up to the application to decide which content remains accessible at the end of a subscription.
New in version 23

Managing subscriptions

Android In Android:
  • If a subscription is listed by inAppListPurchase, the user must be able to access the subscription content.
  • If the subscription was canceled by the user, this subscription will be listed by inAppListPurchase until the next invoicing date and the access to the subscription will be lost at this time. You can allow the user to renew his subscription from the application (inAppPurchaseProduct).
iPhone/iPad In iOS:
  • The subscription is valid between the purchase date and the end date of subscription.
  • An expired subscription can be returned by inAppListPurchase. It is up to the application to decide which content remains accessible at the end of a subscription.

Managing subscriptions

Android In Android:
  • If a subscription is listed by inAppListPurchase, the user must be able to access the subscription content.
  • If the subscription was canceled by the user, this subscription will be listed by inAppListPurchase until the next invoicing date and the access to the subscription will be lost at this time. You can allow the user to renew his subscription from the application (inAppPurchaseProduct).
iPhone/iPad In iOS:
  • The subscription is valid between the purchase date and the end date of subscription.
  • An expired subscription can be returned by inAppListPurchase. It is up to the application to decide which content remains accessible at the end of a subscription.
Components
Android wd230android.jar
Minimum required version
  • Version 19
Comments
Click [Add] to post a comment