RevenueCat / react-native-purchases

React Native in-app purchases and subscriptions made easy. Support for iOS and Android.
https://www.revenuecat.com
MIT License
726 stars 81 forks source link

Add macOS support - Invariant Violation new NativeEventEmitter #405

Open elmcapp opened 2 years ago

elmcapp commented 2 years ago

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

RCGitBot commented 2 years ago

👀 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!

joshdholtz commented 2 years ago

@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 😊

liquidvisual commented 2 years ago

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?

pankti16 commented 2 years ago

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"
aboedo commented 1 year ago

@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 commented 1 year ago

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

elmcapp commented 1 year ago

@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

max-tern commented 1 year ago

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

vegaro commented 1 year ago

@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!