Closed codelocksdev closed 2 years ago
This is essentially the same thing as #5. The module is using a C++ library which basically does not run on the browser.
To expand a little on the above, this library uses the NAPI which is a C/C++ <-> JS compatibility layer specific for node.js
React Native is a completely different beast altogether, it uses compatibility layers specific for each platform, Java <-> JS for Android and Objective-C <-> JS for iOS.
Its not simply a matter of adding support for it, it would require recreating the entire library to use the compatibility layers specific for those platforms.
Instead, you can try using https://github.com/linchCN/react-native-swisseph which appears to be exactly what you're looking for.
Thanks for the explanation, and for finding that alternative! That does look like what I need.
This probably isn't a bug as much as a feature request. I'm running into issues trying to use this package within an expo react native app. I think it's probably got something to do with it being a node binding, and react native doesn't necessarily work out of the box with node core modules.
I ran into this article and it looks like possibly there might be workarounds, but it's a little over my head to figure out. Is there any way to modify this package so that it could be imported into a react native app? https://gist.github.com/parshap/e3063d9bf6058041b34b26b7166fd6bd
Right now I'm stuck with running an external server to use the java swisseph package and the API calls are killing my performance, so I'd love to get the calculations local on the device. Thanks so much!
edit for more info:
this is the (at least initial) error I run into when trying to use the module