File tree Expand file tree Collapse file tree
playbilling/src/main/java/com/example/pbl/kotlin Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -42,8 +42,8 @@ private class Subscriptions(
4242 private fun productReplacement () {
4343 // [START android_playbilling_subscriptions_product_replacement]
4444 val billingClient: BillingClient = this .billingClient
45- val replacementModeForBasePlan: Int = 1
46- val replacementModeForAddon: Int = 1
45+ val replacementModeForBasePlan: Int = SubscriptionProductReplacementParams . ReplacementMode . KEEP_EXISTING
46+ val replacementModeForAddon: Int = SubscriptionProductReplacementParams . ReplacementMode . CHARGE_PRORATED_PRICE
4747
4848 val purchaseTokenOfExistingSubscription: String = " your_old_purchase_token"
4949
@@ -94,7 +94,7 @@ private class Subscriptions(
9494 .build()
9595
9696 // To launch the billing flow:
97- // billingClient.launchBillingFlow(activity, billingFlowParams)
97+ billingClient.launchBillingFlow(activity, billingFlowParams)
9898 // [END android_playbilling_subscriptions_product_replacement]
9999 }
100100
You can’t perform that action at this time.
0 commit comments