Does Expo EAS Update require fetchUpdateAsync? - react-native

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!

Related

Generate ejected expo app through eas build

I created an expo app then i needed to add a printing package and i could not find any that was supported by expo(if there is any please just comment below) so i ejected my app and i added the react-native-thermal-printer package and i want to generate my app apk through eas build.Is there any special configurations i have to set for the non expo supported package or do i generete the apk as normal...I have already set up my eas.json.Also do i include the generated android folder while uploading to eas ?
Any help will be appreciated
I had exactly the same question. I wanted to use the EAS build with a non Expo friendly package. According to the documentation, the eas.json should look a little different on bare project, but it does not offer any example. According to the same documentation, there are no additional steps needed for bare projects, it should work with the same configuration as in managed projects.
You can find the official Expo documentation with this not here: Build configuration process: 2 Create eas.json
PS: I did not find time to test it yet, but it is definitely a starting point. I hope it helps!

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.

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

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

ReactNative, What's the benefit of using expo bare workflow?

There was create-react-native-app just like create-react-app
However I see https://github.com/react-community/create-react-native-app has been merged to expo.
Since I need native (android or ios) support, I can do either of theses
expo bare workflow
https://docs.expo.io/versions/v34.0.0/bare/exploring-bare-workflow/
react native init
https://facebook.github.io/react-native/docs/getting-started (react native cli quickstart)
What do I gain by going through expo bare workflow?
If you use Expo, you can use the module in Expo. Of course, Expo needs to install modules for APK availability starting with SDK33. However, you do not need to link the Expo separately.
If you use Expo, it will automatically reload the code when it is refreshed and not restarted, making it easy to see the code change.
And with fast feedback, the development cycle will be faster. Because the process of communicating from simulator to native apps is still slow, build time will be increased when using Web versions that run directly into the browser, until HMR creates a basic framework for the app because it is fast and fully available with Chrome Developer tools.
Also, if you want to install a React-native module that requires a link, you can use the 'expo eject' command to eject Expo. Then you can use React-native.

Converting project to react native init

Firstly I created my project with create-react-native-app and I'm developing my app with npm start and I have expo installed on my emulator. How can I convert these project into react native init, I don't want to use expo anymore...I don't neeed any api-es from them...
Thank you
The best resource for this is in the create-react-native-app repository. Try having a look here to get started.
The short answer is to use npm run eject
If you have experience generating signed APKs for Android and code signing with iOS then you shouldn't run into too much trouble.
If you don't, then take the time to go through the Android docs and also this guide should help you get up on running on iOS as well.
Good luck!
Instead of creating your project using the command create-react-native-app, you may create a react native project by following "Building Projects with Native Code" of the getting start guide: https://facebook.github.io/react-native/docs/getting-started.html.
Here you will find out how to:
1. Set up the environment.
2. Installation of phone emulator.
3. Connection of your phone via USB for testing.
4. Create a project using the react-native init command.