Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[iOS][Debug] Buying a sub or an IAP makes the app crash #157

Open
PierreCapo opened this issue Oct 31, 2024 · 6 comments · Fixed by #177
Open

[iOS][Debug] Buying a sub or an IAP makes the app crash #157

PierreCapo opened this issue Oct 31, 2024 · 6 comments · Fixed by #177

Comments

@PierreCapo
Copy link

PierreCapo commented Oct 31, 2024

On iOS, in debug mode, around 3 times out of 4 after buying a Subscription or an IAP this problem happens. After the iOS native modal to pay is shown and I pay with an Apple test account, my app crashes (it freezes on the Purchasely paywall)

Those are the Xcode logs I get:

*** Assertion failure in -[RCTEventEmitter sendEventWithName:body:](), /Users/xxxxxx/Documents/xxxxxx/node_modules/react-native/React/Modules/RCTEventEmitter.m:53
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Error when sending event: PURCHASE_LISTENER with body: (null). RCTCallableJSModules is not set. This is probably because you've explicitly synthesized the RCTCallableJSModules in PurchaselyRN, even though it's inherited from RCTEventEmitter.'
*** First throw call stack:
(0x1924787cc 0x18f74b2e4 0x191848a78 0x10cbe39b0 0x10d5683b4 0x1924472f4 0x192447210 0x192447158 0x19244570c 0x10662d9fc 0x10663537c 0x10664578c 0x1066d7174 0x105a10a30 0x105a1271c 0x105a22de8 0x105a229a4 0x19244c204 0x192449440 0x192448830 0x1de4281c4 0x194faeeb0 0x19505d5b4 0x10ba145c8 0x1b7e36ec8)
libc++abi: terminating due to uncaught exception of type NSException

Environment Details
I always develop on a real device, so this bug happens on a real device, but could also happen on simulators I guess.
It can happen on various different iPhone models.
The app uses Purchasely v4.5.3 but this problem has been here for months, so it's not a recent regression.

@hcourthias
Copy link

Same issue here, using v5.0.2. Any updates ?

@kherembourg
Copy link
Contributor

Hello @PierreCapo @hcourthias

Apologies for the late answer, we do not track actively issues here.
I suggest to use our support center from Purchasely console for dedicated support.

Are you using Purchasely.addPurchasedListener()? The crash seems to originate from there, but I am unable to reproduce it.
Are you using that method and able to reproduce the crash consistently under any circumstances after a purchase?

@hcourthias
Copy link

Hello @PierreCapo @hcourthias

Apologies for the late answer, we do not track actively issues here. I suggest to use our support center from Purchasely console for dedicated support.

Are you using Purchasely.addPurchasedListener()? The crash seems to originate from there, but I am unable to reproduce it. Are you using that method and able to reproduce the crash consistently under any circumstances after a purchase?

Hello @kherembourg,

I will use the support center next time! On our side, we are not using Purchasely.addPurchasedListener() but only Purchasely.setPaywallActionInterceptorCallback(). We are also using storekit 2 now. I am not able to reproduce the crash consistently.

@kherembourg
Copy link
Contributor

Thanks for your reply @hcourthias

Then it probably means that the purchase listener is triggered too early in some cases when the application starts and StoreKit queue is being processed.
We are going to make some changes to avoid this in the next version.

@PierreCapo
Copy link
Author

Thanks @kherembourg !
Same as @hcourthias , we are not using Purchasely.addPurchasedListener().

@kherembourg kherembourg linked a pull request Feb 3, 2025 that will close this issue
@kherembourg
Copy link
Contributor

Hello @PierreCapo @hcourthias

We think we found the reason of this crash, we forgot to add an instruction for the Purchase Listener.
We still don't know why we are not able to replicate at all but version 5.0.6 released today should fix your issue.

Thank you very much for your report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants