Solved

"The receipt is not valid" Error with on device sandbox testing

  • 1 December 2021
  • 5 replies
  • 2818 views

Badge +1

Hello!

 

Enjoying using RevenueCat so far but I’ve hit a head dead with iOS integration. I’ve made sure my single product is “Ready to Submit” state on App Store Connect. I’ve made several sandbox apple accounts. My Bundle ID is set up correctly on the RX dashboard. When I go through the purchase flow it all looks successful (including Apple success dialog) but at the final step I get the following RC error:

 

2021-11-30 21:20:34.384306-0500 Pawp[372:8670] [Purchases] - DEBUG: ℹ️ PaymentQueue updatedTransaction: pawp_membership_monthly 1000000921455600 ((null)) (null) - 1
2021-11-30 21:20:34.389609-0500 Pawp[372:8670] [Purchases] - DEBUG: ℹ️ Loaded receipt from url file:///private/var/mobile/Containers/Data/Application/63B42ADB-A483-438C-87A1-B35A40640015/StoreKit/sandboxReceipt
2021-11-30 21:20:34.389793-0500 Pawp[372:8670] [Purchases] - DEBUG: ℹ️ Found 0 unsynced attributes for App User ID: 87214
2021-11-30 21:20:34.391632-0500 Pawp[372:8670] [Purchases] - DEBUG: ℹ️ There are no requests currently running, starting request POST /receipts
2021-11-30 21:20:34.391739-0500 Pawp[372:8670] [Purchases] - DEBUG: ℹ️ API request started: POST /v1/receipts
2021-11-30 21:20:34.578941-0500 Pawp[372:8670] [Purchases] - DEBUG: ℹ️ applicationDidBecomeActive
2021-11-30 21:20:35.097159-0500 Pawp[372:10490] [Purchases] - DEBUG: ℹ️ API request completed with status: POST /v1/receipts 400
2021-11-30 21:20:35.100485-0500 Pawp[372:10490] [Purchases] - ERROR: 😿‼️ The receipt is not valid.
2021-11-30 21:20:35.100798-0500 Pawp[372:10490] [Purchases] - DEBUG: ℹ️ Serial request done: POST /receipts, 0 requests left in the queue
2021-11-30 21:20:35.105653-0500 Pawp[372:8670] [Purchases] - DEBUG: 💰 Finishing transaction pawp_membership_monthly 1000000921455600 ((null))
received action:
UpsellAction.purchaseResult(
Result.failure(
NSError(
domain: "RCPurchasesErrorDomain",
code: 8,
userInfo: [
"NSLocalizedDescription": "The receipt is not valid.",
"NSUnderlyingError": NSError(
domain: "RCBackendErrorDomain",
code: 7103,
userInfo: [
"NSLocalizedDescription": "The receipt is not valid."
]
),
"finishable": 1,
"rc_successfullySynced": 1,
"readable_error_code": "INVALID_RECEIPT"
]
)
)
)

Any idea what else I could be doing wrong? 

Thanks!

Danny

icon

Best answer by Danny Hertz 1 December 2021, 18:04

View original

5 replies

Badge +1

Figured it out, I needed to upload my App-Specific Shared Secret. 

Badge +2

@Fahad Nazir please have a look here: https://docs.revenuecat.com/docs/itunesconnect-app-specific-shared-secret

Badge +2

Unlike y’all, I’m an idiot so it was this TODO… needed the actual API key

 

 

Badge

One thing that helped me (should anyone else stumble in here) was to set up the StoreKit Testing Framework section in RevenueCat.

The description implies that this section is only used for automating Xcode testing, however it is also required for any manual sandbox testing too!

See this guide:

https://www.revenuecat.com/docs/apple-app-store#ios-14-only-testing-on-the-simulator

Badge

I am facing exactly the same issue and I am a bit confused regarding the solution mentioned in the above answer. Where do I need to upload App-specific shared secret?

Reply