Skip to content

Paywalls: pre-fetch intro eligibility for paywalls#2860

Merged
NachoSoto merged 3 commits into
paywallsfrom
paywalls-prefetch-intro-eligibility
Jul 24, 2023
Merged

Paywalls: pre-fetch intro eligibility for paywalls#2860
NachoSoto merged 3 commits into
paywallsfrom
paywalls-prefetch-intro-eligibility

Conversation

@NachoSoto

@NachoSoto NachoSoto commented Jul 21, 2023

Copy link
Copy Markdown
Contributor

This will help provide a better experience when launching paywalls, as hopefully we will have already computed intro eligibility by then.
This is even better than when using StoreKit paywalls.

Note that thanks to CachingTrialOrIntroPriceEligibilityChecker (#2007) this is cached automatically, and also it handles multiple requests with the same or different product identifiers.

Depends on #2865.

@NachoSoto NachoSoto requested review from a team July 21, 2023 21:41
@NachoSoto NachoSoto force-pushed the paywalls-prefetch-intro-eligibility branch from 1a808d1 to 46482ed Compare July 23, 2023 18:26
NachoSoto added a commit that referenced this pull request Jul 24, 2023
I noticed the order of cache updates on SDK initialization was:
- `Offerings`
- `ProductEntitlementMapping`
- `CustomerInfo`

This is inefficient because fetching `CustomerInfo` first is the most important. Also, #2860 will pre-warm intro eligibility, so we want to do that _after_ we might have potentially cleared the intro eligibility cache after a `CustomerInfo` update.

_ Note: I recommend reviewing the diff ignoring whitespace._
@NachoSoto NachoSoto force-pushed the paywalls-prefetch-intro-eligibility branch from 46482ed to 2aa0300 Compare July 24, 2023 09:49
@NachoSoto NachoSoto changed the title [WIP] Paywalls: pre-fetch intro eligibility for paywalls Paywalls: pre-fetch intro eligibility for paywalls Jul 24, 2023

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've changed these so they produce errors instead of crashing the test.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This wasn't used, and it meant that we could have leaked stuff inside of these closures.

@NachoSoto NachoSoto force-pushed the paywalls-prefetch-intro-eligibility branch from 5c9f83c to feb447c Compare July 24, 2023 11:23
Base automatically changed from paywalls-default to paywalls July 24, 2023 13:49
@NachoSoto NachoSoto force-pushed the paywalls branch 4 times, most recently from bf7ffbc to 9f6bb45 Compare July 24, 2023 14:23
@NachoSoto NachoSoto force-pushed the paywalls-prefetch-intro-eligibility branch from feb447c to d83144b Compare July 24, 2023 18:10
@aboedo

aboedo commented Jul 24, 2023

Copy link
Copy Markdown
Member

needs a rebase, right?

This will help provide a better experience when launching paywalls, as hopefully we will have already computed intro eligibility by then.
This is even better than when using `StoreKit` paywalls.

Note that thanks to `CachingTrialOrIntroPriceEligibilityChecker` (#2007) this is cached automatically, and also it handles multiple requests with the same or different product identifiers.
NachoSoto added a commit that referenced this pull request Aug 7, 2023
This refactors #2860 extracting it to a separate type so we can easily extend it to pre-warm the image cache as well (PWL-10).
NachoSoto added a commit that referenced this pull request Aug 7, 2023
This refactors #2860 extracting it to a separate type so we can easily
extend it to pre-warm the image cache as well (PWL-10).
NachoSoto added a commit that referenced this pull request Aug 7, 2023
This refactors #2860 extracting it to a separate type so we can easily
extend it to pre-warm the image cache as well (PWL-10).
NachoSoto added a commit that referenced this pull request Aug 9, 2023
This refactors #2860 extracting it to a separate type so we can easily
extend it to pre-warm the image cache as well (PWL-10).
NachoSoto added a commit that referenced this pull request Aug 11, 2023
This refactors #2860 extracting it to a separate type so we can easily
extend it to pre-warm the image cache as well (PWL-10).
NachoSoto added a commit that referenced this pull request Aug 14, 2023
This refactors #2860 extracting it to a separate type so we can easily
extend it to pre-warm the image cache as well (PWL-10).
NachoSoto added a commit that referenced this pull request Aug 17, 2023
This refactors #2860 extracting it to a separate type so we can easily
extend it to pre-warm the image cache as well (PWL-10).
NachoSoto added a commit that referenced this pull request Aug 22, 2023
… makes no API requests

For `RevenueCatUI` (#2860) we're going to be pre-warming the intro eligibility. It's important to make sure that this won't make API requests.
NachoSoto added a commit that referenced this pull request Aug 24, 2023
This refactors #2860 extracting it to a separate type so we can easily
extend it to pre-warm the image cache as well (PWL-10).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants