In-App Products Module for iOS

API Docs for: 1.0.2
Show:

Purchase Class

Module: Readme

Methods

complete

() final

Available since 1.0.0

Marks the purchase as completed. Your application should call this method from the purchaseUpdate event handler after it has successfully processed the purchase and unlocked the functionality purchased by the user.

Alternatively, you can set the autoCompletePurchases property to true; that will cause the module to automatically complete the purchase right after the purchaseUpdate event is sent.

Note that on iOS, you will receive a purchaseUpdate event not only in response to a call to the purchase function, but also as a result of a call to getPurchases function, or if your app starts up with pending purchases.

Properties

applicationPayload

NSString read-only

Available since 1.0.0

An opaque identifier for the user’s account on your system. Only available on iOS7.0 and above.

downloads

Array of Downloads read-only

Available since 1.0.0

An array of Download objects associated with this purchase.

Only valid if the state is PURCHASE_STATE_PURCHASED. The Download objects stored in this property must be used to download the content before the purchase is completed; after that the download objects are no longer usable.

errorCode

Number read-only

Available since 1.0.0

Only valid if the state is PURCHASE_STATE_FAILED.

errorMessage

String read-only

Available since 1.0.0

Only valid if the state is PURCHASE_STATE_FAILED.

orderNumber

String read-only

Available since 1.0.0

A unique order identifier for the transaction.

originalPurchase

Purchase read-only

Available since 1.0.0

The original purchase associated with this (restored) purchase. Only valid if the state is PURCHASE_STATE_RESTORED.

quantity

Number read-only

Available since 1.0.0

Number of products purchased.

receipt

TiBlob read-only

Available since 1.0.0

Receipt of the purchase. Only valid if the state is PURCHASE_STATE_PURCHASED.

SKU

String read-only

Available since 1.0.0

The item's product identifier.

state

Number read-only

Available since 1.0.0

Purchase state.

time

Date read-only

Available since 1.0.0

Time of purchase.