question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[8.0.1] [iOS] calling finishTransaction crashes app

See original GitHub issue

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

Issue Analytics

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

github_iconTop GitHub Comments

9reactions
hyochancommented, Feb 11, 2022

It’d be working from 8.0.4

6reactions
hyochancommented, Feb 11, 2022

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 🙏

Read more comments on GitHub >

github_iconTop Results From Across the Web

[8.0.1] [iOS] calling finishTransaction crashes app #1637
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...
Read more >
What should I do if finishTransact… | Apple Developer Forums
I am completing a transaction by calling finishTransaction after purchasing the item. ... At worst, the app crashes for using a nil identifier....
Read more >
Crash in StoreKit's finishTransaction - ios - Stack Overflow
In finishTransaction description is written: Calling finishTransaction(_:) on a transaction that is in the purchasing state throws an ...
Read more >
MBS MacCloud Plugin Documentation - MonkeyBread Software
In Mac OS X v10.5 and later and in iOS, you can use ... There is no reason to invoke this method from...
Read more >
Untitled
Fiat 16 gpl, Emoji app for iphone 5! Rajahamsa bus accident, Mezcla para sandwich puerto rico, Wynik ob 46, Angry birds space s-21,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found