Skip to main content

Hello!

I am testing my flutter application on Sandbox environment. I use

addCustomerInfoUpdateListener in order to get customer info ( I call it on app initialization) and then I listen to any changes that may occur. However, if user is offline and subscription expires it does not trigger listener. User has still has access to app. I would expect, that user should loose access to app if subscription expiration date is before now. Should it work like that?
From :

 Michael suggest to call getCustomerInfo. Is it necessary if I’ve just got all the customer information from listener?

If it’s not a bug, but feature, what is your recommendation? Should I set timer myself in a code in order to take access away if expiration date passes?
Thanks in advance for your help!

Hey @mobile-app4ap,

You’re correct, the listener is only triggered during the life of the app on your user’s device - it won’t push an update at the moment of expiration (if they are offline when it comes), but it will once that user opens your app the next time. If you’re concerned that a user’s expiration date may have occurred while they were offline and the listener did not trigger due to this, I’d recommend calling `getCustomerInfo` prior to any user accessing paywalled content - this will update any cache and check if the entitlement is still active, and you can react accordingly.


Hello @kaitlin ! Thank you for an answer. I call getCustomerInfo, however, if I’m offline and my subscription expired, I still have entitlement active and I can access an app. I would expect, that if an user is offline, expiration date/time is checked and if now is after this expiration date/time, user has no entitlement active. When user gets back online, status is updated. I would like to confirm, that the way it works right now is a feature, not a bug? I can understand, that RevenueCat follows the rule : it’s better to give access to unsubscribed user, than take access away from subscribed user. However, still I would like to take access away if user is offline and expiration date passed. What is RevenueCat recemmendation in that case?

While considering that problem I also noticed a bug on Android Sandbox. When user is ONLINE and subscription is renewed automatically, customer info listener is triggered and I get correct entitlement data. However, customerInfo.allExpirationDates does not contain the latest expiration date, which is wrong! For example : I had subscription from 2.00 till 2.05. at 2.05 subscription was renewed, I have now active subscription from 2.05 til 2.10. I get correct entitlement data, but in customerInfo.allExpirationDates  I get 2.05 instead of 2.10. Please note, that I observed this behaviour only on Android, on IOS it works as expected (dates are updated).