How can i store API Keys or API Paths on Github Actions to make Expo read it on Build? - react-native

I am currently building expo ios and android locally, but now i am going to use github actions to build it automatically, but when i do, My expo build doesnt read the env, where can i store and secure .env files to make my expo builds have it again?

Related

.env variables working on expo published app but not from google play build

My app is working properly locally and also from the QR code on the Expo published app page.
On my production build on Google Play though, the .env files are undefined and not loading at all (I am using dotenv-react-native).
This may be due to the fact that my .env file was in .gitignore while I was building my first android build? I updated it with an OTA update after by creating a .easignore file and excluding the .env file. Does it not work with OTA updates? Do I need to rebuild the application or is it some other issue?

Expo release channels and project folder

I am using Expo’s managed workflow. My app uses google authentication to sign in. During development I was using the Expo client for android and as per the docs I used 'Expo.Google' to achieve google authentication and it worked as intended.
After developing the app, I built a staging version of my app (standalone app) by typing 'expo build:android -t apk --release-channel staging-v1' in my project directory. After the build was finished, I downloaded and installed the apk on my android phone. Only then I realized that I didn’t change 'Expo.Google' to 'GoogleSignIn' which is required for standalone apps.
I can change that in my project files and then publish it to the staging-v1 channel. I think this would make google authentication work in the standalone app but it would also change my project files and then it won’t work in the Expo client. So, do I need to create and maintain two different project folders which would basically be the same except for the google authentication part? In general, how should I manage the channels and the corresponding project files?

How to generate signed apk and deploy to google play store

i am using create-react-native-app
there is no android / iOS folder
how to generate signed apk and deploye to google play store
Here are the instructions for create-react-native-app app deployment.
https://github.com/react-community/create-react-native-app/blob/master/react-native-scripts/template/README.md#sharing-and-deployment
If you want to build and deploy your app yourself, you'll need to eject from CRNA and use Xcode and Android Studio.
This is usually as simple as running npm run eject in your project, which will walk you through the process. Make sure to install react-native-cli and follow the native code getting started guide for React Native.
Generating key
https://facebook.github.io/react-native/docs/signed-apk-android.html
If you don't see android/ios folders in your directory. Then type in your terminal react-native upgrade then react-native link

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.

Ejecting from Create React Native App as one of CI step

I created some POC for application in React Native.
I used create-react-native-app as the base for it. It's wrapped with Expo app.
Now I need to create some pipelines for it. I am using Gitlab as my CI.
I suppose that I should eject this application from Expo. But app's development with Expo is really good, I can quickly debug many things there and I have many things out-of-the-box.
How I should create whole flow if after ejecting I need to test it and deploy to Google Play/App Store?
Is it possible to eject this app as the CI step?
There’s no need to eject your app, if all you want is to deploy it to Google Play and Apple App Store. To do this you can use Expo to build a standalone app. The Expo CLI includes commands you can use to build your app to get the .apk and .ipa files for deploying it to the stores.