purchasePackageWith

fun Purchases.purchasePackageWith(    activity: Activity,     packageToPurchase: Package,     upgradeInfo: UpgradeInfo,     onError: (error: PurchasesError, userCancelled: Boolean) -> Unit = ON_PURCHASE_ERROR_STUB,     onSuccess: (purchase: StoreTransaction?, customerInfo: CustomerInfo) -> Unit)

Make a purchase upgrading from a previous sku.

Parameters

activity

Current activity

packageToPurchase

The Package you wish to purchase

upgradeInfo

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

onSuccess

Will be called after the purchase has completed

onError

Will be called after the purchase has completed with error


fun Purchases.purchasePackageWith(    activity: Activity,     packageToPurchase: Package,     onError: (error: PurchasesError, userCancelled: Boolean) -> Unit = ON_PURCHASE_ERROR_STUB,     onSuccess: (purchase: StoreTransaction, customerInfo: CustomerInfo) -> Unit)

Make a purchase.

Parameters

activity

Current activity

packageToPurchase

The Package you wish to purchase

onSuccess

Will be called after the purchase has completed

onError

Will be called after the purchase has completed with error

Sources

Link copied to clipboard
Link copied to clipboard