Using Google play subscription on Android, we provide 2 plans for our users. standard plan (2€) containing minor advantages. premium plan (10€ ) containing the same minor advantages and more.
the problematic case is for standard plan subscribed users, when they upgrade to premium plan, they end up paying both standard and premium at the end of the month if they don't manually signout from the standard plan.
What is the proper way to handle this case ?
We will have the same question on iOS.
Thank you for any help
For the android developpers the full documentation is here:
https://developer.android.com/google/play/billing/subscriptions?hl=fr#trigger-subscription
you have to use "SubscriptionUpdateParams" with previous purchase token and a replacement mode :
BillingFlowParams.SubscriptionUpdateParams.newBuilder()
.setOldPurchaseToken("old_purchase_token")
.setSubscriptionReplacementMode(
BillingFlowParams.ReplacementMode.CHARGE_FULL_PRICE
)
.build()
For those using React native (and the react-native-iap library), the two parameters can be added in the RequestPurchase parameter object:
await RNIap.requestSubscription({
prorationModeAndroid: RNIap.ProrationModesAndroid.IMMEDIATE_AND_CHARGE_PRORATED_PRICE,
purchaseTokenAndroid: oldToken,
sku: productId,
subscriptionOffers: [{
offerToken, sku: productId,
}],
});
I couldn't find any documentation but read some comments in the library source code. (Search for 'requestPurchase' method comments.)