React-native-iap: finishTransactionIOS/finishTransaction this is not working in IOS

Created on 27 May 2020  路  7Comments  路  Source: dooboolab/react-native-iap

Version of react-native-iap

4.4.8

Version of react-native

0.61.5

Platforms you faced the error (IOS or Android or both?)

IOS

Expected behavior

I click in the purchase button and I getting the error is undefined finishTransactionIOS method give me an error (undefined/null).
I send finishtransaction this Purchase Object
I send finishTransactionIOS this purchase.transactionId
all ready send but response was (undefined/null).
Screenshot 2020-05-27 at 6 32 23 PM

Actual behavior

Tested environment (Emulator? Real Device?)

Real Device (I am Using IphoneX)

Steps to reproduce the behavior

@hyochan Can you please help me?

馃摫 iOS 馃檹 help wanted

Most helpful comment

  • i'm having the same issue

All 7 comments

Can you share your code snippet?
I guess I've faced something like this, and want to be sure if it related or not on my issue #1020

It looks like you didn't use a promise?
You should use await when calling finishTransaction

@Mitdd9707 Can this be closed? I think you should share some of your code.

I am having the same issue, this is the code I used.

      purchaseUpdateSubscription = RNIap.purchaseUpdatedListener(
        async (purchase) => {
          console.log(purchase);
          const receipt = purchase.transactionReceipt;
          if (receipt) {
            try {
              const ackResult = await RNIap.finishTransaction(purchase);
              console.log('ackResult', ackResult);
            } catch (ackErr) {
              console.warn('ackErr', ackErr);
            }

            Alert.alert('purchase error', JSON.stringify(receipt));
          }
        },
      );
  • i'm having the same issue

Do we have an update on this???

Closes via #1160

Was this page helpful?
0 / 5 - 0 ratings