purchaseSubscriptionOption

fun purchaseSubscriptionOption(    activity: Activity,     storeProduct: StoreProduct,     subscriptionOption: SubscriptionOption,     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

subscriptionOption

Your choice of SubscriptionOptions available for the subscription StoreProduct

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 purchaseSubscriptionOption(    activity: Activity,     storeProduct: StoreProduct,     subscriptionOption: SubscriptionOption,     callback: PurchaseCallback)

Purchase a subscription StoreProduct's SubscriptionOption.

Parameters

activity

Current activity

storeProduct

The StoreProduct of the product you wish to purchase

subscriptionOption

Your choice of SubscriptionOptions available for the subscription StoreProduct

callback

The PurchaseCallback that will be called when purchase completes

Sources

Link copied to clipboard
Link copied to clipboard