Google-IAP icon indicating copy to clipboard operation
Google-IAP copied to clipboard

Update Subscriptions

Open FelippeFarias opened this issue 4 years ago • 1 comments

Implement the method to Downgrade/Upgrade current subscriptions.

fun updateSubscription (activity: Activity, oldSku: String, purchaseTokenOfOriginalSubscription: String,sku: String) { val flowParams = BillingFlowParams.newBuilder() .setOldSku(oldSku, purchaseTokenOfOriginalSubscription) .setReplaceSkusProrationMode(IMMEDIATE_WITHOUT_PRORATION) .setSkuDetails(fetchedSkuDetailsList.find { it.sku == sku }!!) .build(); val responseCode = iapClient.launchBillingFlow(activity, flowParams) }

FelippeFarias avatar Apr 05 '21 23:04 FelippeFarias

I haven't landed on this use case yet. Sorry for the late reply, I was really tied up with college and everything. If you have the knowledge clear on this, please make a PR. Other than that I will deal with this issue when I find the relevant use case myself and that can take a month even more tbh.

Thanks for bringing this up though :)

akshaaatt avatar May 29 '21 15:05 akshaaatt