Skip to content

Commit 4d8c7c4

Browse files
authored
updated replacement modes to use SubscriptionProductReplacementParams.ReplacementMode (#972)
1 parent 3970dda commit 4d8c7c4

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

playbilling/src/main/java/com/example/pbl/kotlin/Subscriptions.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)