How to tell where React Native app is getting over the air (OTA) / Live updates? - android

I am very new to React Native and Expo. I am now assigned to work on our company mobile app. While doing a build and pushing to Test Flight in Apple Connect, I noticed that my test code is getting Over the Air updated and going live. This is a big problem.
How do I tell from where my app is getting updated live?
I am using the Expo build tools. I checked the configuration for updates in the expo section of the app.json file. It looked like this:
"updates": {
"fallbackToCacheTimeout": 0,
},
Reading the Expo documentation it says the enabled flag is set to true by default. I assumed that was it, so I set the enabled to false.
"updates": {
"fallbackToCacheTimeout": 0,
"enabled": false
},
But my push, which just updated the version number in the app, was pushed live after the app was restarted.
From reading online the behavior is exactly like the Expo OTA update or Microsofts "Code Push". In other words, when users open the app after it's been closed it is the old version. But once they restart, the app updates to the new version.
My build process is this after pushing to my remote git repository:
expo build:ios
Then after the build is queued and builds, I take the download URL and download the .ipa bundle. From there, I use Transporter to check/upload the bundle to Test Flight. Once in Test Flight, I wait until it's done "processing", then I answer the compliance questions (encryption export).
THAT'S IT! I don't create a release in the production side or even touch that.
HOWEVER, if users (who are not beta tester BTW) close and open their app a few times, they get that version that is sitting out in test flight.
I know it's an OTA update for sure because I never issue the expo build:android command but yet....my android phone gets updated too.
I am at my wits end trying to track down where this thing is getting updated. The original developer of the app doesn't have any idea either (i.e. no help).
Any thoughts on how to tell where the thing is being hosted and how it's getting updated.

The reason you are seeing the updates to your production app is because each time you create a new build, expo "publishes" your latest build which pushes any changes OTA to all users unless you use 'release channels'.
Here is the expo documentation supporting the above statement:
https://docs.expo.dev/classic/building-standalone-apps/#3-start-the-build
"Please note: When you run expo build, Expo automatically publishes your app (with expo publish). In order to avoid accidentally publishing changes to your production app, you may want to use release channels."
https://docs.expo.dev/distribution/release-channels/
Once you establish a release channel separate from your production build, you can build separately, and publish OTA updates to that separate build apart from your app that is already live.
This may go without saying, but you can revert your production app using expo publish. As it stands with your current release channel setup, this will also update your TestFlight app.

Related

Why do my alpha releases on Play Store roll out to production users?

I'm publishing an app through Play Store. The app is developed using Expo.
Currently, the production version has internal version code of 4, version name of "1.0.3" and the app has been updated 7th of August.
I recently made some fixes to the app and then built an app bundle with internal version code of 5 and version name of "1.0.4". I published that version to closed testing via the alpha track. Now, clients with no access to the alpha track are getting the alpha version, while the product page in Play Store still shows that the app was last updated 7th of August and has version name of "1.0.3".
What is happening here? Some sort of misunderstanding on my side regarding use of version codes?
Okay, I found out what is causing this. Seems that I didn't read expo documentation carefully enough.
I have been building the releases with command expo build:android -t app-bundle, which, as documented here, also publishes the updates as an OTA update:
Please note: When you run expo build, Expo automatically publishes
your app (with expo publish). In order to avoid accidentally
publishing changes to your production app, you may want to use release
channels.
Since I didn't specify a release channel when building the app bundle, the updates were published to the default release channel.

How to update React native android app with expo

I build an android app in react native and expo. Now I made some changes to the code and was thinking that is it possible to update the app OTA for the users. My app is not published to the play store.
I tried by expo build:apk but this build a new apk file and earlier one has no effect on it.
If you haven't disabled OTA updates for your app you should be able to push an update to the existing app using expo publish command. Just run it in the directory of your project—the project will be built, uploaded to the servers and next time the app starts it will download the update.
See https://docs.expo.io/introduction/walkthrough/#updating-the-app-over-the-air for more information. 🙂

Why does Android Play Protect security scan block a generic Ionic app from installing?

Last week I created a new Ionic4 project and wound up having to rip out everything but Android Studio to exorcise version incompatibilities in the build tools. That seemed to fix everything. However, after sending a client a third or fourth debug-signed APK, he reported he couldn't install it. ADB installed it on my tablet just fine, but it couldn't be installed from a webpage or the file system. Since then, some releases have installed, some not.
Investigating with an APK extractor turned up nothing unexpected.
Then I generated a new Ionic project from the sidemenu template, changed the widget ID to a unique name, and changed the homepage a bit. Nothing that should cause an install fail. And it failed!
LogCat showed an install error -22, but nothing more helpful. Turning off the Security Scan option within Play Protect does allow the app to install. If you turn the scan option back on and force a scan, it oddly doesn't complain about the "unsafe" app. Searching Google hasn't turned up any explanation.
Anyone else run into this? Telling clients to turn off security doesn't look great.

AppCenter's responsibility

I'm trying to figure out the CI portion that provided by AppCenter. I've implemented CodePush for my app and please correct me if my understanding is wrong.
We build the native android app and generate a signed apk.
Release the generated signed apk to playstore
execute command to upload bundle appcenter codepush release-react -a <owner>/<android-app> -d Production
The above are generally the way I understand CodePush and I've tested and working fine.
Now I've noticed that we can integrate our github project branch to appcenter, and whenever there is a git push, AppCenter will build it automatically and we can configure to release to playstore automatically.
Now the part I don't understand is, is this CI auto build by AppCenter actually nothing to do with CodePush?
If now my situation is only having updates on JS code side, actually when I git-push to repo, there isn't a need to auto-release to playstore right?
Correct, Build and Push are separate services in App Center. Build does the binary build of your app while CodePush simply updates the JavaScript and related code in an Apache Cordova or React Native. They're separate workflows and it seems you want to trigger them separate ways.
If you're using CodePush, you can't also use Build to auto build and deploy the native app to devices, you're duplicating work. I'm not an expert, but you probably want to manually deploy your builds whenever you make changes to the native side of the app (which should be rarely, right?) - like when there's major updates to the native framework or new plugins added to the native app

How to configure Crashlytics Android Beta Distribution process?

I have noticed that apps installed with Crashlytics Android Beta Distribution always reinstall app from scratch. Like all my preferences, databases, etc data get lost after each update of the app. Is there any way to configure the update process? Instead of a clean install to have it updating app the same way Play Market performs its updates.
When updating builds in Beta, a normal update should happen and non of your data should be lost.

Categories

Resources