dooboolab-community / react-native-iap

In App Purchase module for React Native!
https://react-native-iap.dooboolab.com
MIT License
2.78k stars 634 forks source link

iOS 17 (and 16.6.1) Cannot read property 'transactionReceipt' of undefined #2546

Open dimaischenko opened 11 months ago

dimaischenko commented 11 months ago

Have you tested support on iOS 17? Among my users already have versions of ios 17 (although the off release is tomorrow, September 18), they are experiencing a crash when trying to purchase. It seems in requestPurchase or requestSubscription. Has anyone encountered this problem? On all previous versions of iOS everything works.

Firebase Crashlytics Logs:

Fatal Exception: JavaScriptError
Cannot read property 'transactionReceipt' of undefined

Environment:

dimaischenko commented 11 months ago

Collected more logs. The error also occurs in ios 16.6.1 (and 17.0) , the purchaseUpdatedListener(purchase) method is called with undefined value in purchase after successful subscription

cervebar commented 11 months ago

It may be because of StoreKit 2 they (Apple) changed API and in this library the transactionReceipt was replaced by verificationResultIOS aka jwsRepresentation - see SubscriptionPurchase type.

Best info about this we found in Apple WWDC videos:

dimaischenko commented 11 months ago

@cervebar Thank you for the response! As I understand it, StoreKit 2 is enabled by:

setup({storekitMode: 'STOREKIT2_MODE'})

I didn't set this at all. So by default I am using Store Kit 1. Or am I wrong?

Yann-prak commented 10 months ago

That's right. From the doc: