RevenueCat / RevenueCat/react-native-purchases
Purchases.getOfferings() performance issue
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.2k
- Forks
- 117
- Avg merge
- 14h 40m
- Merged PRs (30d)
- 40
Description
- I have updated Purchases SDK to the latest version
- I have read the Contribution Guidelines
- I have searched the Community
- I have read docs.revenuecat.com
- I have searched for existing Github issues
Describe the bug
On IOS devices calling Purchases.getOfferings() is extremely slow. For exemple it takes up to 10 seconds on the Iphone 14 I have under my eyes. At least when called for the first time.
-
Environment
- Platform: IOS
- SDK version: 7.1.0
- OS version: 16.4
- Xcode/Android Studio version: 14.3
- React Native version: 0.72.6
- SDK installation (CocoaPods + version or manual): CocoaPods ~> 1.13
-
Debug logs that reproduce the issue
Not relevant
-
Steps to reproduce, with a description of expected vs. actual behavior
const startTs = Date.now();
const offerings = await Purchases.getOfferings();
const endTs = Date.now();
console.log(`⏰ Revenue Cat: getOfferings took ${endTs - startTs}ms`);
// output: ⏰ Revenue Cat: getOfferings took 9454ms
-
Other information (e.g. stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, etc.)
I must say that I have about fifteen different offerings. And I am calling this method right after SDK setup in order to display a paywall on app opening.
Not tested on Android yet.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the first-call latency around Purchases.getOfferings() on iOS using the reported React Native and SDK versions. Compare timing with the setup and roughly fifteen offerings described in the issue; done means identifying and resolving the cause of the excessive initial delay, with the result verified by repeating the timing measurement.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ios, react-native, typescript
- Domain
- mobile, payments
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100