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

Setup storekitMode blocks debugger #2156

Closed professorkolik closed 1 year ago

professorkolik commented 1 year ago

Description

When we execute setup({ storekitMode: <store_kit_mode> });

We no longer able to use Debugger in debug mode.

Expected Behavior

When setting storekit mode, debug is not broken

Screenshots

Screenshot 2022-12-11 at 22 49 56

Environment:

To Reproduce Steps to reproduce the behavior:

  1. Enable debug mode in simulator/emulator
  2. Open React Native Debugger/Chrome DevTools
  3. Error 'Invariant Violation: Calling synchronous methods on native modules is not supported in Chrome.' is shown
andresesfm commented 1 year ago

I'm thinking this is related to the method used to see if Storekit2 is available 🤔

andresesfm commented 1 year ago

@professorkolik Have you tried any of these proposed solutions: https://stackoverflow.com/questions/61067004/invariant-violation-calling-synchronous-methods-on-native-modules-is-not-suppor ?

professorkolik commented 1 year ago

@andresesfm sure we did, and it does the job, but it's a hack, which is not ok. On of the possible solutions I do see is setting storekitMode through env variables, wdyt?

andresesfm commented 1 year ago

I meant not as a permanent solution but to know if you had tried something that worked

professorkolik commented 1 year ago

@andresesfm ah, sorry, yeah the stackoverflow solution works, but it's smth would be nice to avoid. And btw this is not only iOS "issue", I would say it's not platform dependent, just to make sure not confuse other people with iOS label

andresesfm commented 1 year ago

It's strange that here: https://stackoverflow.com/a/69849801/570612 they mentioned it was fixed on rn 0.66

professorkolik commented 1 year ago

I will close this issue, since, nobody else experiences it. Will raise a PR if I find proper solution

c-goettert commented 1 year ago

I am facing this issue as well (using v 12.10.5 with RN 0.70.9). Did you find a proper solution for this @professorkolik ?

Also, I didn't even find the option to configure StoreKit-mode in the official docs, just stumbled across it in this migration guide. I think the docs could use a little upgrade in this regard..

professorkolik commented 1 year ago

@c-goettert My recommendation would be to drop ReactNativeDebugger and switch to Flipper 😄

To configure store kit just call

setup({ storekitMode: <store_kit_mode> }); in your index file