Skip to main content

If you plan to have an app that is offline, then there is some information on RevenueCat’s end that you should be aware of.

A network connection is required to make a purchase and communicate with RevenueCat, but the subscription status is cached on the device as long as needed via CustomerInfo. This way you can still check for a user’s entitlements so they can continue to access your app’s content. When offline, the current state of the subscription will be preserved until it can be re-synced with RevenueCat (e.g. if they're subscribed, they'll remain subscribed).

The app user id and CustomerInfo are cached, and CustomerInfo will be returned while offline forever if the user never goes online, unless something happens that invalidates the cache. The offerings do not persist between app launches, so you will need to cache this data and display them yourself when the app is offline. See our caching docs here for more information.

If you do not want users to have access to their subscription indefinitely while offline, a workaround for this would be for you to keep track of this subscription yourself. You can do an initial check to see if the device is offline, and if it is then take note of the current date. You'll also only want to set this once per offline period. Then you should increment this each day and once this matches the expiration time of the customer's subscription, you can revoke access in your app.

Hi, my iOS app isn’t strictly an offline app, but I would like to have immediate access to offerings on app launch.

How can I do that using the iOS SDK?

    @objc func getOfferings(completion: @escaping (Offerings?, PublicError?) -> Void) {
self.getOfferings(fetchPolicy: .default, completion: completion)
}

 

I’ve looked at persisting Offering myself but it doesn’t appear to support Codable or serialization.

 

 

Also posted here: 

 


Hi, with regard to your last paragraph …

“If you do not want users to have access to their subscription indefinitely while offline, a workaround for this would be for you to keep track of this subscription yourself. You can do an initial check to see if the device is offline, and if it is then take note of the current date. You'll also only want to set this once per offline period. Then you should increment this each day and once this matches the expiration time of the customer's subscription, you can revoke access in your app.”

 

How is this achievable if a user keeps turning back their datetime on their device (to after subscription date but before expiration date) whilst they are offline? There's no way to get actual datetime (server based) since they are offline.


Reply