I have implemented react-native-iap in my tvos project. First time when I go for purchase subscription and call requestPurchase method it open AppleId login prompt and after login it failed payment and called purchaseErrorListener method. But after that on every attempt it works fine.

Environment:

  • "react-native-iap": "^12.10.5"

  • "react-native": "npm:[email protected]",

  • Platforms (iOS, Android, emulator, simulator, device): Apple TV (Real device)

Here is my code for request subscription:

requestSubscription({sku: sku}).then(result => {
   console.log('Subscription rsult-', result);
   subscriptionReceiptValidate(result); 
}).catch(error => {
    console.log("Error==",error)
});

Here is my error log after first attempt and login in AppleId prompt.

Native Log in Xcode

[react-native-iap] Purchase Started

2023-06-28 12:54:56.113414+0530 TopCourt-tvOS[341:60954] <SKPaymentQueue: 0x283bb1030>: 
Payment completed with error: Error Domain=ASDErrorDomain Code=825 "No transactions in response" UserInfo={NSDebugDescription=No transactions in response} 

[react-native-iap] Purchase Failed

purchaseErrorListener log:

2023-06-28 12:54:56.122519+0530 TopCourt-tvOS[341:60967] [javascript] 'purchaseErrorListener=====', { message: 'An unknown error occurred',
  code: 'E_UNKNOWN',
  responseCode: '0',
  productId: 'tcgold_a600_1y',
  debugMessage: 'An unknown error occurred' }

Please help me to fix.

Thank you in advance

0

There are 0 best solutions below