Concern regarding `getAvailablePurchases()`
See original GitHub issueVersion of react-native-iap
4.4.3
Version of react-native
0.61.6
Platforms you faced the error (IOS or Android or both?)
Android
Expected behavior
First of all, thanks for all the efforts you put to make and maintain this library, really appreciate it.
getAvailablePurchases()
should not return subscription that’s canceled (not renewed)
Actual behavior
in the test environment (using test account with test card), when i make subscriptions on my app and cancel the subscription before the expiracytime
(5 minutes after purchase in the test account), my subscription won’t be listed in the result of getAvailablePurchases()
when expiracytime is exceeded. Which is a desired behavior.
However, if i let my subscription to renew (by not canceling before renew period), and then cancel it after that, getAvailablePurchases()
would still list my subscription, even after expiracytime is exceeded. My question is, why does it still list subscription I no longer subscribed to?
Also, I want to know the details regarding getAvailablePurchases()
, does it make a call to google billing to retrieve available purchases? or does it keep the purchase list locally?
test setting: https://developer.android.com/google/play/billing/billing_testing#testing-subscriptions
Tested environment (Emulator? Real Device?)
real device
Steps to reproduce the behavior
subscribe to a subscription, let it get renewed, then cancel. The subscription would still be listed as available purchases
Issue Analytics
- State:
- Created 3 years ago
- Reactions:6
- Comments:11
@darriuk I just tested cancelling subscription and confirm that
autoRenewingAndroid
property is set tofalse
. But! Only if user cancels subscription explicitly. In case of cancelling subscription due to declined payment the subscription stays active forever. This is really big issue with subscriptions and there is no workaround. I had an idea to comparetransactionDate
and if this date is behind subscription term, then do cancel service on my side. But it seems liketransactionDate
is always first date of payment for subscription.@vkachan as far as I recall the
transactionDate
is indeed always for the first subscription payment.One update from me: I ran
getAvailablePurchases
again approx 22 hours after cancelling subscription and it is finally returning an empty array. It looks like Google’s billing server is just taking ages to update the response.I’m going to try a declined subscription payment today and see how long it takes to be removed from the
getAvailablePurchases
response.UPDATE I tested declined subscription payment and
getAvailablePurchases
took approx 32 hours to return an empty array. So the purchase does get removed eventually, it just takes a good while to happen.