react-native-iap icon indicating copy to clipboard operation
react-native-iap copied to clipboard

Getting 21002 from Apple when verifying transactionReceipt

Open AaronCCWong opened this issue 1 year ago • 15 comments

Please use the Discussion board if you want to get some help. Please use issues to report bugs.

Description

Getting { 'status': 21002 } responses when calling /verifyReceipt with transactionReceipt.

Expected Behavior

/verifyReceipt should work.

Environment:

  • react-native-iap: 12.10.5
  • react-native: 0.71.7
  • Platforms (iOS, Android, emulator, simulator, device): iOS

To Reproduce Steps to reproduce the behavior:

The sequence flow I use is as follows:

  1. requestSubscription on button click
  2. purchaseUpdatedListener gets triggered with a purchase object
  3. I call validateReceipt which is a method that sends the following to my web server:
{
        receipt: purchase.transactionReceipt,
        platform: Platform.OS,
        subscriptionId: purchase.productId,
        token: purchase.purchaseToken
}
  1. My web server makes a call to /verifyReceipt with the following request body:
{
    "receipt-data": transactionReceipt,
      "password": SECRET
      "exclude-old-transactions": true,
}
  1. Apple responds with { "status": 21002 }.

This worked until recently when I upgraded expo, react native and react-native-iap.

AaronCCWong avatar May 14 '23 02:05 AaronCCWong