RevenueCat / RevenueCat/react-native-purchases

Purchases.getOfferings() performance issue

Open
#755 13 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug triaged
Dominant language
TypeScript
Stars
1.2k
Forks
117
Avg merge
14h 40m
Merged PRs (30d)
40

Description

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.

  1. Environment

    1. Platform: IOS
    2. SDK version: 7.1.0
    3. OS version: 16.4
    4. Xcode/Android Studio version: 14.3
    5. React Native version: 0.72.6
    6. SDK installation (CocoaPods + version or manual): CocoaPods ~> 1.13
  2. Debug logs that reproduce the issue

    Not relevant

  3. 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
  1. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.