Solution 1 :
Forgot about this question. As the OP in 2021, I resolved this by using Capacitor – A Javascript library that converts your app to Android and iOS builds.
Install Capacitor: npm install @capacitor/core @capacitor/cli
Initialize it: npx cap init
Add Android and (optionally) iOS support: npx cap add android
npx cap add ios
Create an Android app: npx cap sync
Open Android Studio with your new app (to build a .APK): npx cap open android
Optional: Open Xcode to build an iOS app: npx cap open ios
Problem :
I’ve created a React app that looks great on mobile, but rather than a user just visiting my website URL I also want them to be able to install it as an apk through the playstore.
Is there any trivial way to port it to Android, that would allow me to continue to develop just one version of the app? I looked into porting it to react-native, but much of it would need to be recoded. I also considered just opening the app URL in a browser popup, but I’m wondering if there’s a better way.
Thanks –
Edit: Based on Michael’s comment, I’m trying out turning my app into PWA compliant, then using Capacitor to deploy on Android & iOS. I’ll see how this goes and write my own answer if this works out (and no one else answers =o)
Comments
Comment posted by blog.logrocket.com/from-create-react-app-to-pwa
You’re wanting to build what is called a PWA / progressive web app. There are many blog posts detailing this for react such as