Solved

How to refresh user's current offering without restarting app

  • 22 July 2022
  • 3 replies
  • 182 views

Userlevel 2
Badge +3

I am wanting to change a user’s current offering depending on how they answer certain questions in our onboarding flow (before seeing the paywall). I am able to successfully update their current offering using the REST API, but when the user reaches the paywall, the “standard” current offering is still shown, not the user’s customer current offering. I read somewhere that the current offering is cached on app launch. Is there any way to refresh this without having to restart the app?

icon

Best answer by tina 23 July 2022, 01:04

View original

3 replies

Badge +6

Is current offering saved in the RevenueCat database as an attribute of a user? Does it work like so:

  • new user gets assigned the current offering as per the project offerings setup
  • that offering is saved for this user,
  • ‘current’ offering for that user will NOT change, even if current offering in teh project setup is changed. (effects new users going forward).
  • When a transaction occurs, the users current offering is saved with the transaction. 
  • There is no way to tell Revenue Cat database if the client displayed a different offering by a known offering id? Can the client tell the RC backend to change the offering for this user?

 

Userlevel 2
Badge +3

Yes, thank you!!

Userlevel 5
Badge +10

Hey @Jace 

You’re correct that the Offering is fetched upon app launch (or vend from the cache if it’s not stale). We currently do not have a way to invalidate / reset that cache.

However, if you know in the app the Offering identifier the customer is supposed to see after finishing the onboarding flow, you can modify your code logic a bit to not fetch the current Offering.

Here’s an example:

if user.isPaidDownload {
packages = offerings?.offering(identifier: "paid_download_offer")?.availablePackages
} else if user.signedUpOver30DaysAgo {
packages = offerings?.offering(identifier: "long_term_offer")?.availablePackages
} else if user.recentlyChurned {
packages = offerings?.offering(identifier: "ios_subscription_offer")?.availablePackages}

Here’s the Purchases iOS SDK as a reference. Would this work for you instead?

Reply