I using two subscription plans monthly and yearly in my android app. If a user has subscribed monthly plan then I want to give the user an option to upgrade to a yearly plan. I have read an official document I need to use BillingFlowParams.ProrationMode but I am unable to figure out how should I implement this.
Here is the code sample:
BillingFlowParams flowParams = BillingFlowParams.newBuilder()
.setSkuDetails(skuDetails)
.setOldSku(oldSku)
// I need to replace replaceSkusProrationMode to DEFERRED
// how do I get complete path to DEFERRED
.setReplaceSkusProrationMode(replaceSkusProrationMode)
.build()
int responseCode = billingClient.launchBillingFlow(activity, flowParams);
using this link I get the int value for DEFERRED is 4 but it's not a good idea to use hardcoded value.
How should I achieve this?