purchasePackage

fun purchasePackage(    activity: Activity,     packageToPurchase: Package,     upgradeInfo: UpgradeInfo,     callback: ProductChangeCallback)

Purchases a Package. If packageToPurchase represents a subscription, upgrades from the subscription specified by upgradeInfo's oldProductIdand chooses the default SubscriptionOption from packageToPurchase.

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

Parameters

activity

Current activity

packageToPurchase

The Package 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.

callback

The listener that will be called when purchase completes.


fun purchasePackage(    activity: Activity,     packageToPurchase: Package,     listener: PurchaseCallback)

Purchase a Package. If purchasing a subscription, it will choose the default SubscriptionOption.

Parameters

activity

Current activity

packageToPurchase

The Package you wish to purchase

listener

The listener that will be called when purchase completes.

Sources

Link copied to clipboard
Link copied to clipboard