Google has documentation of what to do IF a subscription's price has changed.
You're supposed to use a billing client and launch PriceChangeConfirmationFlow
. However, how do you detect if the price has changed in the first place?
What Android library API would tell me that?
The SkuDetails have the price, but the Purchase details don't. They just refer to the SkuDetails using the "productId". I'm looking at the raw json. If the Purchase object had a price in it, I could compare it to the current price in the SkuDetails, but it doesn't.
When you query for the user inventory with the billing API, you get Purchase
objects which include the purchase time. A bit of a hacky solution is to look at that date and if it's before the time you changed your price, you initiate the flow with launchPriceChangeConfirmationFlow()
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With