Question

addCustomerInfoUpdateListener is not called when subscription is expired or cancelled

  • 26 March 2024
  • 1 reply
  • 19 views

Badge +4

Purchase.addCustomerInfoUpdateListener doesn’t seem to work when subscription is cancelled or expired. Expectation is this callback should be called in this case. However it gets invoked when new package is purchased.

purchases_flutter: ^6.24.0


This post has been closed for comments

1 reply

Userlevel 4
Badge +6

Hey @Willow !

 

This is most likely due to the fact that the SDK caches the last known subscription status on the device. Also, CustomerInfo updates are not pushed to your app from the RevenueCat backend, updates can only happen from an outbound network request to RevenueCat. Calling getCustomerInfo forces a refresh if the cache is older than 5 minutes, which is why you get the update when you call it. This is expected and we recommend calling getCustomerInfo at multiple points in your app, for example whenever the customer navigates to a new screen, we do this so that you keep the cache updated. The SDK is designed to be able to handle many calls to getCustomerInfo for this reason. The listener is great to use when updates happen outside of the app, for example if a customer purchases a free trial directly from the App Store listing of your app. 

 

Let me know if that helps!