Solved

purchaserInfo when no connectivity

  • 6 August 2021
  • 4 replies
  • 260 views

Badge +5

How does the SDK work when there is no cell or wifi?  Which methods will work on device-only, and which ones need connectivity to complete?  Will there be a noticeable delay to the call?   (Is there a doc describing this?)

The case is where you want to test for a valid iOS subscription/entitlement, but there is no network available.  Does it work?

 

icon

Best answer by jazmine 10 August 2021, 23:02

View original

4 replies

Userlevel 3
Badge +7

Hey @TBZ :wave: ,

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.

Badge +5

Are there details available on that reliance?  (so we can plan how to deal with ‘no network’ when it is actually needed?)  I’m trying to understand the sequence of events.

For example, if app is installed, but not launched right away, what would it look like if the app is later launched after leaving wifi zone?  

Thanks.  

Badge +5

Second example…  Once the purchase info appears on the device once, will it be accessible later without network?

 

thank you

Userlevel 3
Badge +7

Hey @TBZ :wave: ,

The SDK will update the cache if it's older than 5 minutes, but only if you call getPurchaserInfo(), make a purchase, or restore purchases, so it's a good idea to call getPurchaserInfo() any time a user accesses premium content.

 

For example, if app is installed, but not launched right away, what would it look like if the app is later launched after leaving wifi zone?  

When launching an app that has been installed , but never connected to wifi ,we wouldn’t be able to display your products because we fetch the information from Google/Apple. Additionally making any purchases requires a wifi connection.  

 

Second example…  Once the purchase info appears on the device once, will it be accessible later without network?

Yes once the purchaserInfo appears on the device it will be accessible without network. It won’t be able to be updated until the user  is connected back to wifi. This means if someone already has a subscription the purchaserInfo will reflect this and even after they leave the wifi the SDK will check whatever the last purchaserInfo is cached on the device. 

Reply