Are there any trade-offs between react-native-permissions and expo-permission? - react-native

I'm trying to select between react-native-permissions or expo-permissions for my project. They both work on iOS and Android but expo-permissions code is more concise. Other than that, are there any trade-offs between the two that I should be aware of?
I'm using bare react-native workflow without Expo.

If you are using a bare react-native workflow you should use react-native-permissions, because expo-permissions is only for expo managed workflows.
Although Expo has react-native-unimodules package that can give you the permissions module.
If you read the docs for expo-permissions you can see this thing in installation guide. Thanks

Related

Does Expo EAS Update require fetchUpdateAsync?

So I'm trying to implement Expo Updates for my managed, standalone build Expo App running SDK 46 following the instructions here: https://docs.expo.dev/eas-update/getting-started/
I'm not having much luck though.
The docs for setup state nothing more than:
npx expo install expo-updates
eas update:configure
eas build:configure
which just alter eas.json and app.json. Is that really all I should need? The docs for the package here: https://docs.expo.dev/versions/latest/sdk/updates/ talk about API methods like Updates.fetchUpdateAsync() but there's no example code. Do I need to implement that in my app somewhere?
Any advice much appreciated!

React Native Error - TypeError: null is not an object (evaluating '_reactNative.NativeModules.RNShare.FACEBOOK')

I'm working on react native project and I am using expo. I want to add the react-native-share package to my project, however I keep getting this error before I even add any code.
TypeError: null is not an object (evaluating '_reactNative.NativeModules.RNShare.FACEBOOK')
Now I know that expo has it's own version of the share, however you can't specify where a person can share it too, which honestly makes the feature useless. It seems to be clear that the reason I can't use this package is because I am using expo and can't install pod into the project -- due to expo reject it --. So what should I do? Any suggestions on how to work around this?
You can't normally use dependencies with native code using Expo. At least when using the classic build system (you're using it when you run expo start in the terminal to run your project). react-native-share has native code (you can check that by going to the repo and seeing if the library has ios and android folders) and therefore can't be used with "standard" Expo.
If you want to use custom native code in your project, you either need to eject from Expo to the bare workflow or - a newer option - use Expo EAS and custom dev clients. Expo EAS allows you to stay in the managed workflow and still use native modules. You might need to write something called a config plugin for some of those native dependencies you want to use, but looking at the documentation, react-native-share should be working just fine without a config plugin.
So: Either eject to the Expo bare workflow, or use Expo EAS and custom dev clients to use native dependencies with the Expo managed workflow. Do note however that you need at least Expo SDK 41 to use EAS and custom development clients.
To learn more about migrating from the classic build system to EAS, see Expo's guide / documentation.

Can I change my workflow from Managed to Bare in React native after I've started my project?

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/

Can I use expo packages or libraries in bare work flow, I used some permissions and

Can I use expo packages or libraries in bare work flow, I used some permissions and apploading these type of blah blah packages in my expo project and ejected to bare work flow, after running react-native run-android getting error expo require expo sdk to run
what SDK version were you on when you ejected? if you are not using the latest sdk version (37 at the time of writing), i would recommend reverting the eject and running expo upgrade then ejecting again. the process is a lot smoother in 37 and will continue to get better over time.
you can absolutely use nearly every library in bare react native apps! but you can't use everything that's available from the expo package itself, we're almost done removing everything from there but they may be some leftovers. check your project to see what you're importing from "expo" and replace those with alternatives. imports from "expo-*" will work great.

Using Exp development workflow with a pure react-native application

Might be a duplicate, didn't find one tho.
I started a new application with the react-native-cli.
I want to use expo for development purpose:
Running on devices through Expo.
Publishing through Expo.
Is such a thing possible?
Copy pasting your 2 questions in Google and the first result...
1.
https://docs.expo.io/versions/latest/guides/testing-on-devices/
2.
https://docs.expo.io/versions/latest/workflow/publishing/
any questions left???
No, its not possible, in the docs its explicitly mentioned you can choose either the expo path or bare react native path. And if you choose expo you can eject from it to pure react native but cant go vice versa because the expo wrapper cant be implemented on the bare app.
so you have to again build an app with expo-cli to use expo publishing facilities etc.
but if you want to use expo modules in bare react native app you can do by using react-native-unimodules .
rn-unimodules
hope it helps. feel free for doubts
If anyone is ever looking for the answer it is stated here:
https://docs.expo.io/versions/v35.0.0/introduction/managed-vs-bare/#bare-workflow
It clearly states that in "bare" workflow you cant use the build services of Expo.