CodePush updating a newly installed app - react-native

I am setting up code-push for my app and found a weird behaviour. I compiled the app for staging and installed it on the android phone and then pushed some updates through code-push which were downloaded fine.
I am not changing the versions of my apk in android/app/build.gradle since i am installing directly from the mac to the phone for testing in staging mode and it overrides the previous installation.
I keep track of the bundle-id for bugsnag and the last bundle-id for code-push is 1.6.5. After some more modifications I ended up creating a new apk for staging that was installed and now the bundle-id is 1.6.7. I haven't pushed this to code-push yet. As soon as the app runs it asks for an update and if I update i get the old bundle (bundle-id 1.6.5) from code-push. Not able to understand why i will get old code as an update. Am i not setting some parameter correctly?
react-native: 0.44.1
react-native-code-push: 2.1.1-beta

You have to push the package to code push and make it available for 1.6.7 version so that it downloads the new package instead of the old one.
You can make the release mandatory and tell code push to download it and update it on next resume like so
codePush({ checkFrequency: codePush.CheckFrequency.ON_APP_RESUME, installMode: codePush.InstallMode.ON_NEXT_RESUME })

Related

Why does CodePush OTA update nuke my fonts?

I've got codepush working for a staging build of an app I hope to soon have in production.
On initial download from the app store, the fonts are looking great! My version checking info that I have in the app shows me that I'm using the bundled version of the bundle.js
If I force-quit and re-launch the app (causing an update) the fonts are no longer found in the application. They display the "missing glyph" image (see screenshot below).
I'm hoping for either a solution, some tricks to try, or just some ideas about how to further debug and understand what is causing this. I'm a little stuck because when I try to run the app in debug mode, it just uses the latest codepush version instead of downloading a new one.

How to deploy codespush bundle on old targets when there are native changes on the new build

Before i continue, let me let you know that i know the code to deply to a targeted build for codepush
appcenter codepush release-react -a aountName/appName -d Production -m --description "CommentHere" -t versionName
I have tried to figure this out on my own and i have not been able to.
I have several versions of my app which i have deploy using CodePush and everything works well but I started having fears of crashes when i installed new packages on the latest build.
This implies the current code base would have new native differences as compaird to the old version.
The question is how can i deploy my new build with new native codes
and packages present to an old version of my app which does not have those
native packages without running into several crashes from all the users using the old version of the app...
I ask this cos i have a feeling if i push the new build with the new changes in UI and native chnages to the old version of my app, the app old app would crash.
If a bug comes in for an old version, how do I fix it and deploy it
for the old version only? Bugs may be critical and not everyone will
have the latest version of the app Or, the bug may only exist on a old
version of the app.
I await your response.
Code push will not affect any native code written within the Android or the iOS projects of a React-Native application. If you read the documentations carefully, it specifically says that it does not change / modify / update the native portion of the app.
Why?
This is because of the way the CodePush mechanism works. In essence, CodePush only stores and triggers the update of the JS bundle of the React-Native application.
This is why we wrap only the JS main app instance with CodePush HOC (Higher Order Component). This is what's happening when you do:
CodePush(MyApp); //wrapping the js bundle at app-root
So, unfortunately in your case, if there are native codes involved, regardless of deployment to a new or old version of the app, it has to be a AppStore / Playstore driven deployment.

Code-Push with CI/CD and native dependency changes

I am readying an app for release to the app stores and I'm concerned with CI/CD pipeline and Code-Push.
How does this scenario play out:
If a developer makes NPM dependency updates and there is a package updated that has native code changes that the JS relies on, will Code-Push still update the JS bundle on user devices ahead of their device downloading the native code updates?
Just so my question is clear, I'm not trying to OTA update native code - I'm referring to a situation where some package like react-native-device-info has native Java/Swift code and also has JS code that requires some api or event constant from the native code. If you bump the package version for react-native-device-info to a new release and there is changes to both native and JS code, would code-push have any way to know to not update the bundle until the native code/app was updated because the JS bundle has code that depends on the native code?
Or, am I thinking of using the tool Code-Push wrong?
The way codepush works is that it updates the JS bundle of your app. Your requirement is to update a NPM package which has a native change and update only your client side which is not possible.
If you do this you will probably end up with a crash of your app when the JS contacts the native code.
would code-push have any way to know to not update the bundle until the native code/app was updated because the JS bundle has code that depends on the native code?
Simple answer NO
Codepush is targeted on a version number so your new version which hits the stores will have a new version number so no point of updating the bundle of the old version of the app.
If you really want all your users to move to a new version push an alert or some sort of message using codepush asking the user to update.

expo v29 not loading assets in ios release build

I've been using expo with ExpoKit since v23 and made some iOS releases with those versions, when upgraded to release 29, debug build was working fine as usual.
But when I created a release build, all images stopped showing.
In this gist I share my podfile, app.json and package.json: https://gist.github.com/jper92/f705c71c455c760bd6c10e9cbdeac16c
Also made sure to update the EXShell.info file with the correct versions, tried to add and remove the local bundling, caching them in the initial splash with Asset.fromModule, and carefully read all steps to upgrade to v29 and I'm still having the issue, any suggestion?

React-Native Expo Built App Doesn't Get the Latest Javascript

Ok, I have a problem with expo build. Please let me know if you need more details. Basically, the project I am working on is NOT detached. It is just using Expo.
So I publish it. Let's say the javascript bundle version is 0.17, and I am publishing a breaking change to 0.18.
When I load the app from Hockey App, the javascript bundle is clearly not 0.18 because I don't see my breaking changes. Then, I close the app and re-open it, and the JS bundle is updated.
The build script is:
exp build:android
[exp] Android:
[exp] APK: [AWS LINK] apk has been generated, it took 0 seconds
Then, I get an AWS link to the APK, which I download and upload to Hockey Apps.
How should I diagnose this problem?
Exp version is 44.0.0
It is the way it works in Android. First time you open your app after you publish, the code is downloaded in background. Next time it will run the new code.
Quoting the documentation:
Updates are handled differently on iOS and Android. On Android, updates are downloaded in the background. This means that the first time a user opens your app after an update they will get the old version while the new version is downloaded in the background. The second time they open the app they’ll get the new version. On iOS, updates are downloaded synchronously, so users will get the new version the first time they open your app after an update.