Question

iOS Testing staging and production apps, receipt invalid

  • 29 September 2023
  • 2 replies
  • 78 views

Badge +1

Hi, Im trying to test staging and production apps separately on iOS. To do this, I created separate targets with separate bundle ids. I then followed the guidelines here:

Since I only need to test locally on device and on the simulator, I created a StoreKit configuration test file and downloaded the cert. I then created a separate project in RC with the staging app bundle ID (I already had one with my production app), the app secret from AppStoreConnect, the Storekit cert, and the products setup to match the Storekit configuration file.

I’ve double checked to ensure that in the bundleID matches the bundleID in XCode. I’ve also checked to ensure that the products setup match the products in the StoreKit config file. But, when I try to complete a purchase in my staging app, I get the following error

ERROR: 💰 Product purchase for '(product' failed with error: Error Domain=RevenueCat.ErrorCode Code=8 "The receipt is not valid."

If I click the button a second time it tells me I have already made the purchase before and “subscription will renew on ..”. I have checked other threads to troubleshoot the “receipt invalid” error but none of them seem to point to anything else I can try.

Any help would be appreciated! 


2 replies

Userlevel 6
Badge +8

Hey @ani!

It sounds like this may be due to the StoreKit certificate uploaded to our dashboard being out of date - if any changes to the StoreKit Config occur, the certificate needs to be re-uploaded: https://www.revenuecat.com/docs/apple-app-store#step-4-uploading-the-public-certificate-to-revenuecat 

 

Can you give that a try?

Badge +1

Hi @cody thanks a lot for your response. I deleted and re-downloaded the StoreKit certificate but I get the same error :(.  I’ve also double checked that the Bundle ID matches between the target and what’s setup in RC. Any other suggestions? 

Reply