purchaseProduct

fun purchaseProduct(    activity: Activity,     storeProduct: StoreProduct,     upgradeInfo: UpgradeInfo,     listener: ProductChangeCallback)

Purchases storeProduct. If storeProduct represents a subscription, upgrades from the subscription specified by upgradeInfo.oldProductId and chooses storeProduct's default SubscriptionOption.

If storeProduct represents a non-subscription, upgradeInfo will be ignored.

Parameters

activity

Current activity

storeProduct

The StoreProduct of the product you wish to purchase

upgradeInfo

The upgradeInfo you wish to upgrade from, containing the oldProductId and the optional prorationMode. Amazon Appstore doesn't support changing products so upgradeInfo is ignored for Amazon purchases.

listener

The PurchaseCallback that will be called when purchase completes.


fun purchaseProduct(    activity: Activity,     storeProduct: StoreProduct,     callback: PurchaseCallback)

Purchases a StoreProduct. If purchasing a subscription, it will choose the default SubscriptionOption.

Parameters

activity

Current activity

storeProduct

The StoreProduct of the product you wish to purchase

callback

The PurchaseCallback that will be called when purchase completes.

Sources

Link copied to clipboard
Link copied to clipboard