react-native-iap: [8.0.1] [iOS] calling finishTransaction crashes app

Hello! Thank you for building such a great and useful package. We’ve migrated from expo-in-app-purchase as it appeared RNIap is better maintained and provides offer code redemption functionality. We installed straight from npm and it appears the latest 8.0.1 version is not yet stable – we’re getting consistent crashes after calling RNIap.finishTransaction via real device (stack trace below). For now we’ve downgraded to the latest 7.5.6 release and it works as expected. We are using Expo SDK 44 bare (see version details below). Please let me know if I can provide anymore information. Thanks so much for your awesome work.

Version of react-native-iap

8.0.1

Version of react-native

react-native: 0.64.3 expo sdk 44 bare

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

iOS

Expected behavior

Calling RNIap.finishTransaction(product, true/false) should not crash the app.

Actual behavior

Calling RNIap.finishTransaction(product, true/false) causes a crash every time with stack trace:

OS Version: iOS 12.5.5 (16H62)
Report Version: 104

Exception Type: EXC_CRASH (SIGABRT)
Crashed Thread: 17

Application Specific Information:
+[NSInvocation _invocationWithMethodSignature:frame:]: method signature argument cannot be nil

Thread 17 Crashed:
0   CoreFoundation                  0x37186d180         __exceptionPreprocess
1   libobjc.A.dylib                 0x36fd319f4         objc_exception_throw
2   CoreFoundation                  0x3717624d4         +[NSInvocation _invocationWithMethodSignature:frame:]
3   App                            0x2004fc724         facebook::react::JSIExecutor::defaultTimeoutInvoker
4   App                            0x2004ff510         facebook::react::JSIExecutor::defaultTimeoutInvoker
5   App                            0x200501af8         facebook::react::JSIExecutor::defaultTimeoutInvoker
6   App                            0x200501730         facebook::react::JSIExecutor::defaultTimeoutInvoker
7   libdispatch.dylib               0x370da1a34         _dispatch_call_block_and_release
8   libdispatch.dylib               0x370da27d0         _dispatch_client_callout
9   libdispatch.dylib               0x370d4b320         _dispatch_lane_serial_drain$VARIANT$mp
10  libdispatch.dylib               0x370d4be3c         _dispatch_lane_invoke$VARIANT$mp
11  libdispatch.dylib               0x370d544a8         _dispatch_workloop_worker_thread
12  libsystem_pthread.dylib         0x3711b8110         _pthread_wqthread
13  libsystem_pthread.dylib         0x3711bacd0         start_wqthre

Tested environment (Emulator? Real Device?)

Real Device - iOS 12.5.5

Steps to reproduce the behavior

  • using a real device
  • set up RNIap as per documentation (init, purchaseUpdateListener, etc)
  • call RNIap.requestPurchase(sku) for a product
  • in purchaseUpdateListener, handle new purchase by unlocking feature
  • after feature is unlocked, finish the transactions by calling RNIap.finishTransaction(purchase, true/false)
  • App crashes

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 18 (3 by maintainers)

Commits related to this issue

Most upvoted comments

It’d be working from 8.0.4

My bad! I just found the problem. The Swift code did not bridge to objc method correctly. I’ve just fixed this.

Sorry for the inconvenience 🙏