React native automatic update from store - react-native

Hi guys I need my react native app to update it self automatically (with user consent) when new version is published to the store (both android and ios)
I need the app to download the apk or ipa and complete the update process, not using CODE PUSH or OTA,
is it possible?

The app itself can't do that.
The closest thing you can do is:
Verify app version against the version on the server (if you have a back end).
Present a button to the user which will open the app store off your platform directly at your app's page, using deep linking.
You will have to keep server and deployed app versions in sync.

Related

Expo app deleted know unable to deploy new app on google play store

I have created react native app using Expo and deployed it on the Google play store and it was live and working. Unfortunately, the expo app was deleted from my system.
I want to update my app with new features and bug fixes, so I created a new expo project how can I deploy it to the same app on the google play store?
The project needs to have a higher version, as the existing one, same bundleID and you need to use the same upload key to upload the app to the play store

modifying a bundled react native app using expo

I have created a react native using app and created an apk for that using expo. Now I have to make some modification in that app. So do I need to build that again using build:android? or Is there any method to modify content in bundled app
If you have the over-the-air updates that expo offers enabled (I believe it's enabled by default), then whenever you publish your app (expo publish), the app on your phone will update automatically (you don't need to download the new apk). That also works when the app is on Play Store.
The way this works, is basically the app requests an updated js file from a public url on launch and runs that js instead of the old one. I personally dislike this approach so I disabled OTA updates for my app. In case you do too, then, you either need to manually listen for updates in your app (please refer to the above link) or install the new apk every time you build a new version (this is only useful in development).

Do OTA updates in Expo get in motion on the first opening after brand new download from the stores?

I developed an app with React Native and distributed it with Expo. I published the final version into Google Play and Apple Store.
Some time later I discovered in Expo's docs on Publishing that expo publish allows you to create an OTA ("over the air") update that is built into Expo and updates the app automatically, according to this answer:
The standalone app knows to look for updates at your app's published url.
This I tested and worked very well.
However, now I see that people downloading the app from the stores (that is, either Google Play or Apple Store) apparently get the initial version of the app, not the updated one.
What is the exact workflow for the OTA updates? Do they go and "replace" the existing version in Google Play and Apple Store the first time they open it? Or do they need to open it over again to get the update?
And what exactly triggers the update of the app?
We've been having similar problems. I can see two things which might be causing this in your case:
Check in app.json if updates.fallbackToCacheTimeout is set. If it's set, that's how long expo will try to download the latest update before showing the last downloaded version (which will be the initial version after initial download).
If you have a large update, expo will try downloading the update for 30s before showing the last version of your app.
Check here for more info: https://docs.expo.io/versions/latest/guides/configuring-ota-updates/
OTA updates do not replace the version downloaded from the app store, they are stored first in the device's cache before being run on app start after download. Source https://docs.expo.io/versions/latest/sdk/updates/
Update downloads are automatically triggered on app start, then, depending on the settings it will either wait (as long as updates.fallbackToCacheTimeout allows) before showing the app, or show it immediately.
You can force the app to run the latest update (if you have one waiting) by just force quitting the app, then restarting.
Hope this helps!

Expo uses old code even though new code has been deployed

I have a react-native app that is using Expo.
In the beginning of the project I pushed some code to the default publishing channel that was never intended to be used in production.
Since then I have released dozens of versions to production and mostly all works as expected. (New installs gets the latest JS code)
However, a few users still gets old versions of the code, even though they literally just downloaded the app from App Store / Google Play.
This is extremely frustrating. How can I make sure that fresh downloads of the app will download the correct/latest version och my JS?
Note that this is not related to the app detecting new code that might be available for download. It is the fact that the wrong code is downloaded and used to begin with. Is there any way to remove all JS-code except the very last version that I published? I imagine that would solve my issue
Turns out, expo don’t always do this successfully. You need to rebuild the react native bundle before publishing.https://proandroiddev.com/bundling-react-native-during-android-release-builds-ec52c24e200d
This is what expo gives as a feature known as Over the Air updates (OTA). Whenever a new version is built with expo channel, it automatically updates even in the app store and play store. But there is a way to disable the updates. the expo documentation for disabling:
It is possible to entirely disable OTA JavaScript updates in a standalone app, by setting updates.enabled to false in app.json. This will ignore all code paths that fetch app bundles from Expo's servers. In this case, all updates to your app will need to be routed through the iOS App Store and/or Google Play Store.
This setting is ignored in the Expo client.
And I do recommend you to read the documents of OTA, which is a good feature when you get to know all of it.
The expo link is expo OTA

React native code update

I published my first app to AppStore last night.
I just want to know if there is code change in my app,
Should I have to re-build and upload .ipa file to itunes connect again?
(Currently, I do not use CodePush and I build app with exp)
Thanks.
Expo comes with a built in CodePush equivalent.
Whenever you publish to expo (using exp publish, the XDE etc), expo builds new JS bundles and uploads them to their servers.
Users who downloaded the app from the stores will get those updates - while iOS users will get them as soon as they open the app, Android users will get them in the second time (iOS is does this syncly while Android asyncly).
Note that this does not apply to changes in the app config (app.json), including sdk upgrades or any other configuration changes.
Yes, you will need to rebuild the release version of your app and upload to the App Store as a new version.