Skip to main content
Answer

Timing question on purchasePackage() method in React Native SDK

  • February 9, 2025
  • 1 reply
  • 39 views

Forum|alt.badge.img

In my app I use the webhook from RevenueCat to keep my backend in sync with customer entitlements and enforce the entitlement check on every request from the app.

I know that webhooks are async and there might be some lag, so what I do is check the database first for the active entitlement, and if it is not found or inactive, I hit the RC API as a fallback.

My question is on the front end - in the React Native SDK, when the promise resolves on the purchasePackage() method, can we assume at that point everything is in sync between the App Store or Play Store and RevenueCat? Even if the first webhook were delayed a little, would I immediately find the user’s active entitlement via the API in my fallback check? Hopefully this makes sense.

Best answer by Haley Pace

Hi, yes as long as the purchase makes it to RevenueCat you should immediately be able to find it via the API. To reduce any delay in this, I also recommend enabling platform server notifications if you haven’t already: https://www.revenuecat.com/docs/platform-resources/server-notifications

This post has been closed for comments

1 reply

Forum|alt.badge.img+8
  • RevenueCat Staff
  • Answer
  • February 12, 2025

Hi, yes as long as the purchase makes it to RevenueCat you should immediately be able to find it via the API. To reduce any delay in this, I also recommend enabling platform server notifications if you haven’t already: https://www.revenuecat.com/docs/platform-resources/server-notifications