i am trying to implement the Hot Code Push for my mobile client.
I have looked at where to indicate the environment variable AUTOUPDATE_VERSION, my application is loaded on a server with Meteor MUP, the variable should I set it in the mup configuration file ?
Some like this:
AUTOUPDATE_VERSION: [value ?],
And what value I have to set ?
I also saw this “https://blog.meteor.com/hot-code-push-step-by-step-bd940de7323c” but I can’t find right value to set…
I wrote that blog. Sorry I didn’t go much into this topic.
You don’t need to implement Hot Code Push; it should work by default if you fit the listed prerequisites.
Is yours not working? I’m happy to help you debug if you tell us more.
AUTOUPDATE_VERSION is probably not the issue. You don’t need to set one, unless you want to sometimes prevent Hot Code Push from happening. The only situation in which an
AUTOUPDATE_VERSION can fix your HCP is if you already had one set in the past, and you forgot to update it.
If you are going to set it, the way you do it looks right to me, but I haven’t used MUP.
You can set it to any string you want. The only thing that matters is whether or not it is identical to the previous ones.
Thank you for get me this info.
To verify that the app is updated, in the mobile-config.js file I indicate the version like this:
description: 'my awesome app',
author: 'awesome team',
I changed “version: ‘20200831’” with “version: ‘20200901’”
I load on the server with MUP and open my app, I see that the code is transferred and the app reloads, as well as in the browser, but if I go to see the app info it always shows me the original version (“20200831”), not the one I indicated .
For this i think the HCP does not work.
Do you have some advice that can I do it ?!
Hot Code Push only works with front end code.
Mobile-config.js is a special file, which is only used to generate the cordova builds. So until you make a new build, the changes in that file do nothing. The filedoesn’t go to the server, and isn’t pushed to the front end.
When you change something in your front end HTML / CSS / JS, does it take effect?
Yes, my “site” changed but it’s normal behaviour, Cordova keep all in a browser view.
I thought that HCP loaded everything for the app.
When you change something in HTML, CSS or JS, view in Cordova is like normal browser, loaded new version of files, but don’t load assets (icons, images) and I thought it’s for a bad HCP.
As you can see in Meteor documentation, HCP load everything, also assets.
Or i’m wrong ?
You’re right that it should load the assets from the
public folder as well. What assets is your app not receiving?
A few assets like the app icon and launch screen can only be used by
mobile-config.js, and so regardless of whether the client is receiving them, only a new build can apply them.
Ok, but so what is the difference from normal reload “site” and HCP ?
Now I’m confusing…
The main differences from my point of view are:
- On both web and cordova, the user doesn’t have to click refresh, and doesn’t have to know WHEN they should refresh. They simply receive the update whenever it’s ready
- In Cordova apps, there is no such thing as a “normal reload” in the first place