InAppPurchase

external interface InAppPurchase : EventEmitter(source)

Properties

Functions

Link copied to clipboard
external fun addListener(type: EventType, listener: EventListener)
Link copied to clipboard
abstract external fun canMakePayments(): Boolean

whether a user can make a payment.

Link copied to clipboard
external fun emit(type: EventType, vararg args: Any?): Boolean
Link copied to clipboard
Link copied to clipboard
abstract external fun finishAllTransactions()

Completes all pending transactions.

Link copied to clipboard
abstract external fun finishTransactionByDate(date: String)

Completes the pending transactions corresponding to the date.

Link copied to clipboard
external fun getMaxListeners(): Double
Link copied to clipboard
abstract external fun getProducts(productIDs: ReadonlyArray<String>): Promise<ReadonlyArray<Product>>

Resolves with an array of Product objects.

Link copied to clipboard
abstract external fun getReceiptURL(): String

the path to the receipt.

Link copied to clipboard
external fun listenerCount(type: EventType, listener: EventListener): Double
Link copied to clipboard
Link copied to clipboard
external fun off(type: EventType, listener: EventListener)
Link copied to clipboard
external fun on(type: EventType, listener: EventListener)
Link copied to clipboard
external fun once(type: EventType, listener: EventListener)
Link copied to clipboard
external fun prependListener(type: EventType, listener: EventListener)
Link copied to clipboard
external fun prependOnceListener(type: EventType, listener: EventListener)
Link copied to clipboard
abstract external fun purchaseProduct(productID: String): Promise<Boolean>
abstract external fun purchaseProduct(productID: String, opts: PurchaseProductOpts = definedExternally): Promise<Boolean>
abstract external fun purchaseProduct(productID: String, opts: Double = definedExternally): Promise<Boolean>

Returns true if the product is valid and added to the payment queue.

Link copied to clipboard
Link copied to clipboard
external fun removeAllListeners(type: EventType)
Link copied to clipboard
external fun removeListener(type: EventType, listener: EventListener)
Link copied to clipboard
abstract external fun restoreCompletedTransactions()

Restores finished transactions. This method can be called either to install purchases on additional devices, or to restore purchases for an application that the user deleted and reinstalled.

Link copied to clipboard
external fun setMaxListeners(n: Number)