ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Mobile specific functions / In-App Purchase functions
  • Special cases
  • Managing subscriptions
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Returns the list:
  • of application products purchased by the user and not consumed.
  • of active subscriptions for the user.
iPhone/iPad This function is now available for iPhone/iPad applications.
Example
// Récupération de la liste des achats de l'utilisateur 
inAppListPurchase(ListeAchat, inAppPurchaseID)
PROCEDURE ListeAchat(bSuccès is boolean, sListeAchat is string)
	IF NOT bSuccès THEN
		ToastDisplay(ErrorInfo())
	ELSE
		// Parcours les achats effectués
		FOR EACH STRING sInfoAchat OF sListeAchat SEPARATED BY CR
			// Récupère l'identifiant du produit
			sIDProduit is string = ExtractString(sInfoAchat, 1, TAB)
			// Récupère l'identifiant de l'achat
			sIDAchat is string = ExtractString(sInfoAchat, 2, TAB)
			// Consomme le produit si nécessaire
			IF sIDProduit = "ID_PRODUIT" THEN
				inAppConsumeProduct(sIDProduit, ConsommationProduit)
			END
		END
	END
END
PROCEDURE ConsommationProduit(nSuccès is boolean)
	IF NOT bSuccès THEN
		ToastDisplay(ErrorInfo())
	ELSE
		// Consommation du produit dans l'application
		...
	END
END
Syntax
<Result> = inAppListPurchase(<Procedure> [, <Type of information>])
<Result>: Boolean
  • True if the purchase list retrieval request has been carried out,
  • 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.
iPhone/iPad Information not available. Always corresponds to 0.
inAppOrderIDNumber of the order corresponding to the purchase.
inAppPurchaseDatePurchase date in YYYYMMDD format.
In the case of a subscription: subscription date.
For renewals: initial subscription date (not renewal date).
inAppPurchaseIDIdentifier of purchase.
Android This identifier is used in inAppConsumeProduct to consume a product that was purchased.
iPhone/iPad This identifier has the same value as the one obtained with the inAppOrderID constant.
inAppSubscriptionEndDateEnd 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).
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.
iPhone/iPad At consumable product is always consumed when it is purchased and therefore if will never appear in the result of inAppListPurchase.

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.
Component: wd300android.aar
Minimum version required
  • Version 19
Comments
Click [Add] to post a comment

Last update: 06/12/2025

Send a report | Local help