Question

Does the getCustomerInfo function work periodically in a non-sandbox environment?

  • 29 December 2022
  • 1 reply
  • 51 views

Badge +3
Documentation indicates that getCustomerInfo is updated every 5 minutes in a sandbox environment, and similarly, in a sandbox environment, the maximum number of updates may be limited even for subscriptions. But does it work well in production? In other words, is it OK to call getCustomerInfo every time the user tries to access the content to check eligibility?

 

++

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.

 

 

 

I read the above. Does getCustomerInfo mean that it is automatically updated every 5 minutes in case of purchase or restoration without calling it separately, and if not, it should be called and used every time to obtain subscription qualification?

1 reply

Userlevel 4
Badge +8

But does it work well in production?

 Yes as people don't notice the 5 minutes when subscriptions renew every week/month/year. It is more noticeable in sandbox due to the accelerated time.
 

In other words, is it OK to call getCustomerInfo every time the user tries to access the content to check eligibility?

Yes, it is perfectly fine to do this, getCustomerInfo was built for this kind of usage.
 

Does getCustomerInfo mean that it is automatically updated every 5 minutes in case of purchase or restoration without calling it separately, and if not, it should be called and used every time to obtain subscription qualification?

It's not automatic. You should always call getCustomerInfo to get the latest status

Reply