react-native-purchases icon indicating copy to clipboard operation
react-native-purchases copied to clipboard

Calling setState while Paywall is being presented causes paywall to close on iOS

Open kjossendal opened this issue 11 months ago • 1 comments

Describe the bug A clear and concise description of what the bug is. The more detail you can provide the faster our team will be able to triage and resolve the issue. Do not remove any of the steps from the template below. If a step is not applicable to your issue, please leave that step empty.

  1. Environment
    1. Platform: iOS
    2. SDK version: 8.2.1
    3. OS version:
    4. Xcode/Android Studio version: Expo managed
    5. React Native version: 0.74.5
    6. SDK installation (CocoaPods + version or manual): cocoapods
    7. How widespread is the issue. Percentage of devices affected. All
  2. Debug logs that reproduce the issue: No logs provided
  3. Steps to reproduce, with a description of expected vs. actual behavior
  4. Other information (e.g. stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, etc.)

Additional context If I present the paywall from a modal that is triggered by a setState mutation, then want to close that modal while presenting the paywall, the paywall either opens and immediately closes or never opens to begin with.

const closeModalAndShowPaywall = () => {
    setIsModalShowing(false)     <-- setting state
    const paywallResult: PAYWALL_RESULT = await RevenueCatUI.presentPaywall({
      fontFamily: "Roboto",
    });
}

kjossendal avatar Nov 01 '24 17:11 kjossendal