updateSubscription
open fun updateSubscription(activity: Activity, newSubsId: String, oldPurchaseToken: String, replacementMode: AppPurchase.SubscriptionReplacementMode): String
Upgrades or downgrades a subscription.
Return
Result message.
Parameters
activity
The activity context.
newSubsId
The new subscription product ID.
oldPurchaseToken
The purchase token of the current subscription to replace.
replacementMode
The replacement mode (proration mode).
open fun updateSubscription(activity: Activity, newSubsId: String, @Nullable offerToken: String, oldPurchaseToken: String, replacementMode: AppPurchase.SubscriptionReplacementMode): String
Upgrades or downgrades a subscription onto one specific offer of the new product.
Needed when the target subscription has several base plans or offers and the user picked one — the no-token overload would otherwise fall back to Play's last offer.
Return
Result message.
Since
4.4.0
Parameters
activity
The activity context.
newSubsId
The new subscription product ID.
offerToken
Offer token from getOfferToken, or null to let the library choose.
oldPurchaseToken
The purchase token of the current subscription to replace.
replacementMode
The replacement mode (proration mode).