Question

How do we differentiate if customerInfo is missing entitlements because not purchased or because offline

  • 20 November 2023
  • 5 replies
  • 25 views

Badge +2

When I get a test customer’s CustomerInfo while offline it looks exactly the same as if the user simply had no entitlements. How can we tell the difference - how can we know if a user has NOT made a purchase or if they are simply offline? If there anything in the CustomerInfo that can tell us? I feel like we can’t know for sure if a purchase has NOT been made.


5 replies

Badge +2

For example, a user may have purchased the app, then obtained a refund. We check CustomerInfo periodically to verify that the app has been purchased. We need to know if it was refunded. But a CustomerInfo with no entitlements (where there had previously been entitlements) does NOT mean that an app was refunded. It could simply mean that the user is offline. Am I wrong?

Userlevel 3
Badge +6

Hey There,

 

The SDK caches the user's subscription information to reduce your app's reliance on the network. Users who unlock entitlements will be able to access them even without an internet connection. 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() any time a user accesses premium content. As soon as RevenueCat detects a refund, the CustomerInfo will be updated to reflect the correct entitlement status - no action required on your part! If you have questions about refunds, take a look at our community article covering the topic.

 

So in your case, based on the cached info, the user should be able to have access to there subscription even when offline, and when a refund happens that updated object should be reflected. If the entitlements are gone in this case, it is likely that the subscription was refunded and cancelled, expired, or the user never had a subscription in the first place. 

 

Let me know if that helps! 

Badge +2

It doesn’t help with my actual issue - I can never know for sure if an item was NOT purchased. The response is exactly the same for offline and online-not-purchased. Other SDK’s tell you in the response that the user is offline or give some indicator. With your SDK, I can never know. So I would never revoke the purchase based on the CustomerInfo because — what if the user is just offline and it is not up to date? This cripples me as far as knowing for sure that we either KNOW (and it is purchased or NOT purchased) or we are OFFLINE AND NOT SURE. I hope that makes sense. Adding a message or some other measurable indicator to the response about offline state would be very, very helpful.

Badge +2

Also, we should have an indicator to tell if we are dealing with cached info or real-time info.

Userlevel 3
Badge +6

While you won’t know whether or not that user is online or offline, you will still know accurately whether or not they have an active subscription despite their internet connection because if they do have a subscription it will be cached and if they don’t have one, then them not having one would be cached as well.

 

The team is always looks for ways to improve, so I do appreciate this feedback on implementing something that lets you know whether or not the user is currently online! 
 

Let me know if that helps! 

Reply