Skip to content

Issue with PAYWALL_RESULT Returning CANCELLED Instead of PURCHASED #1213

@ynpl

Description

@ynpl

Describe the bug
I am currently in the testing phase and facing an issue where, after a successful payment, the result returned is PAYWALL_RESULT.CANCELLED instead of PAYWALL_RESULT.PURCHASED. I have tried multiple times, and I am sure the payment was successful. I can also see the successful subscription in my account.

Here is the code I am using:

const handlePaywallClick = async () => {
  try {
    const result = await RevenueCatUI.presentPaywall();
    console.log('Paywall result:', result);
    switch (result) {
      case PAYWALL_RESULT.PURCHASED:
        console.log('User completed the purchase');
        // Handle post-purchase actions, such as unlocking features
        break;
      case PAYWALL_RESULT.RESTORED:
        console.log('User restored the purchase');
        // Handle purchase restoration
        break;
      case PAYWALL_RESULT.CANCELLED:
        console.log('User closed the paywall');
        // Handle user closing the paywall
        break;
    }
  } catch (error) {
    console.error('Error with the paywall:', error);
  }
};

Could you please advise on what I should do to resolve this?

Thank you.

  1. Environment
    1. Platform: IOS
    2. SDK version:8.8.0
    3. OS version:18.2
    4. Xcode/Android Studio version: 16.2
    5. React Native version:0.76.7
    6. SDK installation (CocoaPods + version or manual): CocoaPods
    7. How widespread is the issue. Percentage of devices affected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions