react native - should I run the server with the command react-native start so that users can use the app? - react-native

When deploying react-native, should I run the server with the command react-native start so that users can use the app?

Hope this question understand when you react-native start
What are the difference between these React Native start commands?
React-native start should use in development environment. When your device or simulator connected to server

I think you mean building the apk file by "deploy". If i'm right and you have used some APIs in your app, you should run the server of your backend app to let your react native application send and receive data.

Related

Expo - Build in local

I have a question and I didn't find a clear answer.
It's possible to build android and iOS app in local ?
We can build the application with expo build:android and expo build:ios but these commands need an account and send the source code in server of expo.
I see it's possible to eject the app and folder android and iOS are created but after that I keep the possibility to develop with expo ? If I modify a javascript code I can recreate again the android and iOS folder ? or I need to develop in native code ?
Thank you for your answers !
As far as I understand your question, If you eject the app, you can't develop with expo. But, you can keep editing in javascript. There is no necessity to develop in native code.

Can I not use Expo (cloud service) at all using React Native

I have build an app using react native(detached) but the thing is I would want to completely get rid of Expo. The reason is, what if one day EXPO service get shut down or no more supported.
So in this case I would not want the app to be affected.
Currently I need to publish my app thru ExpoKit to see the latest changes, how would I build my android app so it would not have any reference to Expo but still be able to work properly
Currently this is how I understand how the react native and expo works: first u build ur app using react native code and then a bundle.js is generated somewhere on cloud(EXPO) using publish command so the app communicate with that bundle.js.
Note I am not using any feature from Expo so why would I need Expo in this case?
Edited: If I am detaching my app from expo, I mean why would I still need Expo? Can't I just build the app and run the app without expo at all?
You can build your whole application without using expo, just follow the steps from facebook documentation in "Building Projects with Native Code" tab.
or
you can run "npm run eject" in your project root directory folder.
After this, you can build your appliaction using react-native cli commands, like
react-native run-android.
edited :--
For building apk for production, you can follow steps given in facebook documentation as generating signed apk and for released IPA for iOS yo can follow building your app for production for IOS.

How to properly start a detached React Native app

I am using React Native for the first time and I can see that we can detach from the Expo. I have no reason to detach, but I am sure will have later so I will detach from the start.
Question: What is the commands to start directly detached app using react native commands.
I have used create-react-native-app my-app then run expo detach this seemed to detach the app but for some reason only android folder is showing while ios folder is missing, anyone have any idea how do I have both platforms created on a detached version!
Thanks
A Mac is required to build projects with native code for iOS. You can follow the Quick Start to learn how to build your app using Create React Native App instead.
As per the react-native docs, you can't detach & develop for iOS unless you are on a Mac. Link(Under Building Projects with Native Code)

how to run react native code from server? i want to release app in android and apple store

I am an android developer and learning react native.
I made an app in React Native and now I want to release my app in android play store and apple store but I don't know where do I put my react native project code/files?
I had put react native code in my PHP(Linux) server but it's not working, it says file not found 404.
please guide, Thanks
You need to generate build standalone signed apk.
Generating Signed APK
https://facebook.github.io/react-native/docs/signed-apk-android.html
1) first create keystore file and put in android folder location
2) setting up gradle for keystore
3) run comman
react-native run-android --variant=release
after success run command you will file apk-release.apk in andorid/app/build/outputs/apk/ location
then you can uplaod apk to app store
If your app doesn't need detach (for example doesn't use bluetooth) you can use create-react-native-app and put your app code inside new project. That way you can publish your app to https://expo.io/ . It's a great way to publish your app without Google Play and App Store.
Here is instruction for creating new react native app with expo kit:
https://facebook.github.io/react-native/docs/getting-started.html
And here is how to publish it into expo:
https://docs.expo.io/versions/v25.0.0/guides/publishing.html#how-to-publish
All you need is create-react-native-app and exp command line tools.

Can I use any other app instead of Expo to run react native app?

Can I use any other app instead of Expo to run react native app?
Expo is not compatible with my phone.
Yes, you can use the way suggested in the react-native docs under using a real device. You'll need adb installed, then just enable USB debugging on your phone and plug it in. Run react-native run-android in the command line to send your program to your phone.
Note that these steps may differ depending on how far you've followed to the directions for either expo or react-native.