Skip to main content
Question

Android AppInBackground is always true

  • August 10, 2024
  • 1 reply
  • 12 views

Forum|alt.badge.img+4

Hello,

I’m using the latest Revenue Cat SDK (8.4.0) and i’m trying to do the following use case in Sandbox :

  • Subscribe to a monthly subscription
  • Immediately refund it from Revenue Cat dashboard
  • Open the app and see that the premium content is no longer available for the user

I’m calling

Purchases.sharedInstance.getCustomerInfoWith(fetchPolicy = CacheFetchPolicy.NOT_STALE_CACHED_OR_CURRENT) { customerInfo ->
            checkStatus(customerInfo)
        }

And always get this Logs :

 

Retrieving customer info with policy: NOT_STALE_CACHED_OR_CURRENT
ℹ️ Checking if cache is stale AppInBackground true
ℹ️ Vending CustomerInfo from cache.

 

Something weird here, is that AppInBackground is always returning TRUE. This means that the cache will not be stale before the 25 hours delay and never within the 5 minutes delays for foreground application. Then the cache is never updated

I’m initializing my Purchases only once in the onCreate of my Application class

if (BuildConfig.DEBUG) {    Purchases.logLevel = LogLevel.VERBOSE}Purchases.configure(PurchasesConfiguration    .Builder(this, "API_KEY")    .build())

I’ve put breakpoints in the 

PurchasesOrchestrator : 
onAppBackgrounded and onAppForegrounded

Where the appInBackground is updated, but these methods are never called

I’ve found out that the same questions was asked here : 

 But there is no solution provided

 

Thank you for your help :)

This post has been closed for comments

1 reply

Forum|alt.badge.img+4
  • Author
  • Member
  • 6 replies
  • August 10, 2024

Sorry the subject has been send twice, you can close this one and answer on this one : 

 


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