Skip to main content

Hello,

 

`ERROR - The receipt is not valid. The purchased product was missing in the receipt. This is typically due to a bug in StoreKit`.


I was recently rejected from app store review due to this weird RevenueCat bug ("react-native-purchases": "5.13.0") that I sometimes experience.

I believe that I have set up all of my code correctly, but when clicking on a subscription purchase (using the purchaseProduct method - `const purchase = await Purchases.purchaseProduct(identifier, null, Purchases.PURCHASE_TYPE.SUBS);`) the request can fail and throw the following error. “The receipt is not valid. The purchased product was missing in the receipt. This is typically due to a bug in StoreKit.” It seems that this error will happen in patches 5-10 times in a row, then once I see one success, they are all successful from there forward (the purchase modal shows up with the product, and the user can subscribe to my subscription). Now when I go back into the app, I cannot reproduce the bug as it will be successful once I get one success (if that makes sense). Eventually I will return to my app later and the bug will show up again. I have seen the bug show up in sandbox testing only, and have been unable to pass app store review due to this issue. Also I am trying to get more verbose debug logging in react native on iOS, I tried adding Purchases.setLogLevel(Purchases.LOG_LEVEL.DEBUG) in the setup before `configure`. It seems that the docs surrounding this are outdated - how can I get debug logging on a dev client (expo) with the react native SDK?

Please help.

Thanks,
Carl

 

I have been going crazy with this problem that suddenly caused my Flutter iOS app to be rejected by Apple for the first time in tens of versions over one year. I tried literally ALL the advice that helped people in ALL the many forums and pages on this darned error, and nothing helped until I saw this post. I created a new sandbox tester and the error went away immediately. Thank you Mike!

Hey Talicom,

I’m so glad I was able to help out a fellow developer in need! I feel like In-App Purchases are almost like voodoo. Even with RevenueCat greatly simplifying the process, there are still a lot of stars that need to align and magic incantations to invoke in order to get it working.


I hit this error today.  FWIW, I got around it in the (React Native) dev client by using a different (Apple) sandbox user for the purchase.  I think that after you use a sandbox user for enough purchases, Apple’s servers get confused after a while about which things that user has or hasn’t already purchased and they spit out errors.  This might not be the fix for everyone, but maybe it will help a few of you.

I have been going crazy with this problem that suddenly caused my Flutter iOS app to be rejected by Apple for the first time in tens of versions over one year. I tried literally ALL the advice that helped people in ALL the many forums and pages on this darned error, and nothing helped until I saw this post. I created a new sandbox tester and the error went away immediately. Thank you Mike!

P.S. This is a disgraceful situation for Apple to put developers in. A server going down temporarily (like what happened a year ago according to many posts) is one thing. But, rejecting apps on review repeatedly for no reason other than a bug in their sandbox testing, that can be easily avoided by using a new tester account, is inexcusable.​

 

I'm having the same problem in my Flutter iOS so I did this and deleted my sandbox user and created a new one (never used) and I'm still having the same issue and can't move forwards because of this error. Also, this is happening on my testing environment (on debug and on TestFlight), so it doesn't need apple's approve in this situation.

 

Using the flutter lib in version 8.1.1 and Apple's monitor service doesn't show anything down. 


If you're encountering issues with your app, particularly when testing subscriptions in a sandbox environment, you should be aware that RevenueCat imposes a limit of 100 subscription receipts per customer for performance reasons. This limit typically shouldn't affect production apps, but during testing, especially if you're simulating multiple subscription setups, you might hit this threshold.

Solution: Deleting the Customer in RevenueCat To resolve this, you can delete the specific customer and their associated receipts from the RevenueCat dashboard. This will clear the test environment for that user and allow you to simulate a fresh subscription setup.

For more details on how to delete customers in RevenueCat, refer to their documentation [https://www.revenuecat.com/docs/test-and-launch/sandbox/apple-app-store#ios-14-only-testing-on-the-simulator].


Hi all,

Thanks a bunch for all of the tips and tricks shared here! This thread is quite old and a lot has changed since the first post, so it’s time to close it to ensure people don’t mix up outdated info with legitimate workarounds. To summarize:

  1. RevenueCat now uses StoreKit 2 end-to-end from the SDK to the server. All of the edge cases and glitches have been resolved regarding the interaction between StoreKit 1 and 2. If you do see any issues, please open a new community post or support ticket so we can look into them. Nowadays we find StoreKit 2 to be more stable and feature rich compared to StoreKit 1, which Apple has deprecated. Any recent RevenueCat SDK version will use StoreKit 2 automatically.
  2. Testing with new sandbox users is always a good troubleshooting steps as sometimes old users with many purchases can bog down Apple’s sandbox system.
  3. Issues with Apple App Store rejections can sometimes be due to glitches in the sandbox environment that the reviewer uses. Most tips we’re aware of can be found in this guide: https://www.revenuecat.com/docs/test-and-launch/app-store-rejections

I’ve marked this reply as the best answer solely to display this reply on the front page for others to immediately see. Thank you all again for your contributions!