react-native-purchases icon indicating copy to clipboard operation
react-native-purchases copied to clipboard

Add macOS support - Invariant Violation new NativeEventEmitter

Open elmcapp opened this issue 2 years ago • 9 comments

I am trying to use revenuecat with React Native for macOS however I get the following error. Invariant Violation new NativeEventEmitter requires a non-null argument.

I like to know if revenuecat supports React Native for macOS. If not could you please add support for this

elmcapp avatar Aug 15 '22 18:08 elmcapp

👀 SDKONCALL-97 We've just linked this issue to our internal tracker and notified the team. Thank you for reporting, we're checking this out!

RCGitBot avatar Aug 15 '22 18:08 RCGitBot

@elmcapp Thanks for reaching out! Our React Native SDK does not currently support macOS but it is on a radar to add support for now! I don't think I have a time frame of when that will get added yet but we'll keep this issue open and close it when its added 😊

joshdholtz avatar Aug 15 '22 19:08 joshdholtz

I'm getting the same error message from just running import Purchases from "react-native-purchases" on iOS under React Native - what does this mean?

liquidvisual avatar Aug 15 '22 23:08 liquidvisual

I'm getting the same error message from just running import Purchases from "react-native-purchases" on iOS under React Native - Expo

"expo": "^45.0.0",
"react-native-purchases": "^5.0.0"

pankti16 avatar Aug 25 '22 14:08 pankti16

@Pankti16 for Expo, you will have to make Development builds in order for the SDK to work.

This is documented here: https://www.revenuecat.com/docs/reactnative#option-2-using-expo

The easiest way to get it done is by doing a development build running one of the following:

npx expo run:ios -d
npx expo run:android -d

aboedo avatar Sep 23 '22 14:09 aboedo

note that RevenueCat doesn't currently support react-native for macOS, so these instructions are for iOS and Android

aboedo avatar Sep 23 '22 14:09 aboedo

@joshdholtz @aboedo Is it possible that we could have an update soon to include this. It's really needed. I did a little testing this weekend I was able to use some of the native code for RevenueCat macOS and pass the data to react native bridge. Everything works however on the end of the users we have to write the native code then write the code for react native side. Is there any way we would have React Native for macOS included in the next update or a beta update of RevenueCat

elmcapp avatar Sep 28 '22 00:09 elmcapp

hey, get the same error when running just React-Native (not expo). Clean project 0.71 RN adding SDK got this error.

max-tern avatar Apr 09 '23 12:04 max-tern

@max-tern Do you mind creating a new issue for that? Since it looks like you're getting it on a non-macOS device, we should be tracking it as a separate issue. Thanks!

vegaro avatar Apr 14 '23 10:04 vegaro