Question

After a few renewals and before the cancellation subscriptions don't load in Android

  • 6 February 2023
  • 4 replies
  • 240 views

Badge +4

I have a problem fetching the current subscriptions from the Google Play Store/RevenueCat.

As you can see in the picture, activeSubscriptions is empty. The monthly subscription shows up with the correct purchase date but not the expiration date of the newest renewal.

I have some active purchases, which get also displayed correctly with the corresponding entitlement, but the entitlement for the subscription also does not show up.

After calling restorePurchases() the subscriptions reappears, so I don’t think it’s a configuration issue. Also directly after buying the subscription it is showing up correctly for the first few renewals (before the automatic testing cancellation). The logs show `Vending CustomerInfo from cache` so probably the subscriptions don’t get cached correctly?

I appreciate any help as this is an issue we don’t want to release the app with.


4 replies

Badge +4

Ok, I dug a little deeper and tried some things. Could the problem be that the cache is longer valid than a few renewals in testing (so x times 5 minutes for a monthly subscription)? So after a few renewals the _allExpirationDates still contains an old value and that’s why it won’t show an active subscription? Because the expiration date stays the same for longer then the expiration itself even if it should already be renewed.

Userlevel 6
Badge +8

Hey @SimonHe, yeah, it’s likely that the cache on-device is what’s causing the weird behavior when testing with the accelerated subscription schedule. Can you try calling `invalidateCustomerInfoCache` before checking subscription status to ignore the cache and see if it’s working as intended?

Badge +4

Thank you for your response. That doesn’t seem to resolve the issue. As you can see I invalidate the cache, and in the bottom terminal it is showing that it’s fetching from network. But it is still not showing an active subscription (In the left upper corner you can see the response I’m getting from `getCustomerInfo()`). That always happens around the fourth renewal of the subscription, and it does seem to be a problem of the API response I’m getting, because after the next renewal it often works again, but sometimes ist does fail again on the renewal after that.

Badge +4

@cody We released the app now. With yearly subscription it did work in the test environment, but it would be nice to get feedback so I can be sure that it is not an issue on our side which I can fix. As I explained in my last message it doesn’t seem to be an issue with the caching.

Reply