What is the best way to use Aes encryption/decryption on an Expo project without ejecting it (without going to react native like or bare Workflow) ?
at first i was tempted to use react-native-aes, but this use the NativeModules. does a pure vanilla JS (like crypto-js with no node dependency because of iOs issus) could be the proper solution ?
Solved
I used Crypto-js#3.1 that has no Node dependency, worked on Android and iOs
Related
is there no way to read serial number using expo. I should be able to read using external packages like react-native-device-info but I can’t do this without expo? because when i install this package i get this and similar errors. I tried react-native link solution but it didn't work. I need to use expo for other reasons so I can't eject it. There is no part in expo device and constants where I can read these properties.
react-native-device-info depends on platform-specific native modules which will not link and compiled with the Expo Go client.
Expo SDK provides a compatible alternative package to use with Expo Go Client - https://docs.expo.dev/versions/latest/sdk/device/
I was wondering if I can change my workflow from Managed to Bare in React native after I've started my project ?
If so, what are the consequences ?
Assuming that you're using Expo-CLI (and not react-native cli), you can, of course expo eject your project to change from manage workflow, to bare one.
Here is the documentation : https://docs.expo.io/bare/exploring-bare-workflow/
After some investigation, I realized I'd have to detach/eject my Expo app in order to use libraries such as nodejs-mobile-react-native, a library that allows you to run (and ship) a NodeJS singleton thread with your client app.
So the problem here is that I can't use this library unless I detach - something that I've been doing my best thus far to avoid. It sees all references to this library as null and I've tried to even manually link it.
Is there perhaps another approach that someone knows of that allows you to run Node alongside React-Native, which is compatible with Expo?
I have also used Expo in the past and because of similar limitations I switched over to Native Development using Swift but, in your situations what you can do is:
expo eject
in the application directory to detach your app from expo, once you have done this then you will have a plain react native app, then you can add any nodejs packages compatible with React Native.
Done!
I have developed only by native CLI since I started RN, but I have become interested in CRNA or Expo recently.
But if I want to use a library which expo does not support, I heard I have to do a eject.
I often make mobile apps for IoT products, so I think I should use Bluetooth or Wi-Fi library, so I think I should use a library that is not supported by expo unconditionally.
In such an environment where an unconditional eject must be made, does using expo or crna have advantages over using the native CLI?
One possible advantage of using Expo even after ejecting is that after ejecting, you can opt to have a native project linked to ExpoKit. ExpoKit is a native library that allows you some of the same conveniences that you would have when using the Expo client.
https://docs.expo.io/versions/latest/guides/expokit.html
Expo is great. One of it's goals is to use only javascript to write React Native apps.
How do you determine if a third party React Native library will work in the Expo development environment?
The simplest approach is to look at the install instructions of the library.
If react-native link is mentioned then it won't work with Expo.
You can run any library by Detaching to ExpoKit but you will lose some of the benefits of using Expo in the first place.