PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
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
Used to consume, in an application, a product that was previously purchased by the user. Once consumed, the product will be made available for another purchase.
Reminder: In Android, you cannot purchase a product that was already purchased by the user. The product must be consumed before it can be purchased again.
Example
// Asks to purchase a product
inAppPurchaseProduct(MyProduct, PurchaseProduct)
PROCEDURE PurchaseProduct(bSuccess is boolean, Product is inAppProduct, PurchaseID)
IF not bSuccess THEN
ToastDisplay(ErrorInfo())
ELSE
// Consume the product
inAppPurchaseProduct(MyProduct, PurchaseID, ConsumeProduct)
END
PROCEDURE ConsumeProduct(bSuccess is boolean)
IF not bSuccess THEN
ToastDisplay(ErrorInfo())
ELSE
// Consume the product in the application
...
END
Syntax
<Result> = inAppConsumeProduct(<Product to Consume> , <Purchase Identifier> , <Procedure Name>)
<Result>: Boolean
  • True if the request for product consumption was performed,
  • False otherwise. To find out the error details, use ErrorInfo.
<Product to Consume>: Character string or inAppProduct variable
  • Identifier of the product to the consume,
  • Name of inAppProduct variable corresponding to the product to consume.
<Purchase Identifier>: Character string (with quotes)
Purchase identifier of product to the consume. This identifier is received when purchasing a product with inAppPurchaseProduct. It can also be retrieved by inAppListPurchase.
<Procedure Name>: Character string (with or without quotes)
Name of WLanguage procedure ("callback" procedure) run when receiving the response to the request for product consumption. This procedure has the following format:
PROCEDURE <Procedure Name>(<Success> is boolean)
<Success> is boolean:
  • True if the product was consumed,
  • False otherwise. To retrieve the error details, use ErrorInfo before any other call to a WLanguage function (that would reinitialize the error).
Remarks
  • inAppListPurchase is used to retrieve the products purchased by the user and not consumed yet.
  • inAppConsumeProduct has no effect if it is run from the Android simulator or emulator.
  • Versions 23 and later
    You cannot consume a subscription.
    New in version 23
    You cannot consume a subscription.
    You cannot consume a subscription.
  • inAppConsumeProduct is available on the devices running Android version 2.2 or later (api level 8).
    A fatal error occurs 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.
Component : wd240android.jar
Minimum required version
  • Version 19
Comments
Click [Add] to post a comment