Skip to main content
Question

Change in onPurchaseCompleted Behavior

  • March 5, 2025
  • 1 reply
  • 28 views

Forum|alt.badge.img

We've recently upgraded to RevenueCat SDK 8.6.1 in our React Native app and noticed a change in how the paywall events are triggered, for both our old Paywall v1 and new Paywall v2.

Previously, when a user subscribed, the onPurchaseCompleted method was called as expected. However, in the latest version, users who start a trial now first trigger onPurchaseStarted and then onDismiss, without onPurchaseCompleted being called.

Here’s our implementation:
 

const handlePurchaseStarted = useCallback(({ packageBeingPurchased }: { packageBeingPurchased: PurchasesPackage }) => {
  posthog.capture("onboarding_paywall_purchase_started", {
    packageIdentifier: packageBeingPurchased.identifier,
  });
}, [posthog]);

const handlePurchaseCompleted = useCallback(async ({ storeTransaction }: { storeTransaction: PurchasesStoreTransaction }) => {
  posthog.capture("onboarding_paywall_purchase_completed", {
    transactionId: storeTransaction.transactionIdentifier,
    productIdentifier: storeTransaction.productIdentifier,
  });

  await onComplete();
}, [onComplete, posthog]);

const handleDismiss = useCallback(async () => {
  posthog.capture("onboarding_paywall_dismissed");
  await onComplete();
}, [onComplete, posthog]);

<RevenueCatUI.Paywall
  // only works for paywall v1
  options={{ displayCloseButton: isDismissible }}
  onPurchaseStarted={handlePurchaseStarted}
  onPurchaseCompleted={handlePurchaseCompleted}
  onDismiss={handleDismiss}
/>

We’re trying to confirm whether this is an expected change in SDK 8.6.1 or if there’s something we need to adjust in our implementation.

Has anyone else observed this behavior after upgrading? Any insights would be greatly appreciated!

Current versions:

  • "react-native-purchases": "^8.6.1"
  • "react-native-purchases-ui": "^8.6.1"
  • "react-native": "0.76.7"
  • "expo": "52.0.36"

1 reply

joan-cardona
RevenueCat Staff
Forum|alt.badge.img+6
  • RevenueCat Staff
  • 313 replies
  • March 7, 2025

Hi ​@xxRichardxx,

Do you mind updating to the version 8.8.0 and see if that still happens? We had an issue around the purchases delegates that was fixed in later versions.

 

Best,


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings