Skip to main content
Question

Purchases.getCustomerInfo returns incorrect (cached) value, no matter what fetch policy I try

  • April 22, 2024
  • 1 reply
  • 147 views

Forum|alt.badge.img

I am using Android SDK, revenuecat version 7.0, and this is my code (kotlin):

Purchases.sharedInstance.getCustomerInfoWith(
            fetchPolicy = CacheFetchPolicy.FETCH_CURRENT,
            onError = { error: PurchasesError ->
                log("END with ERROR = $error")
            },
            onSuccess = { customerInfo: CustomerInfo ->
                val purchased = customerInfo.entitlements["premium"]?.isActive
                log("END with SUCCESS: isActive = $purchased")
            })

Consider following scenario:

  1. Before purchasing a product = getCustomerInfo properly returns no active entitlements (as I never purchased the product)
  2. After I purchase the product = getCustomerInfo properly returns existing active entitlement (as I just purchased product)
  3. After I refund my purchase in Play Console (including checked checkbox "Remove entitlement") =  getCustomerInfo incorrectly still returns I do have active entitlements. Even after hours, even after I specifically used fetch policy forcing fresh server value...

Such behavior is in my opinion not correct…

Is it a bug or am I doing something wrong? Why is revenuecat getCustomerInfo function not returning the latest fresh result? Or is that intended behavior, that entitlements still remain active, even after I manually perform refunding? If so, can this be turned off?

This post has been closed for comments

1 reply

Michael Fogel
Forum|alt.badge.img+6
  • Dedicated Contributor
  • 382 replies
  • April 24, 2024

Hey @mil84,

 

I recommend calling getCustomerInfo() somewhere else in the app as well so this object is updated when the app is opened regardless. Is the method called in the case of 3 where the refund happens and then the user opens the app up later? The SDK will update the cache if it's older than 5 minutes, but only if you call getCustomerInfo(), make a purchase, or restore purchases, so it's a good idea to call getCustomerInfo() often to ensure the object is up-to-date.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings