Alright, some times it works reliably, some times it doesn’t.
I have a published Android App, and it doesn’t pick up HTML, JS, IMG changes all the time.
However, I recently updated the server, and thankfully, my Android app did pick up the changes. So I don’t think it’s a problem on the Mobile client, but something on the web server that’s not passing the information to force updates on clients.
When Googling this, there’s lots of questions and no answer.
So, how does the HTP technology work? Is there a variable I can set that FORCES an HCP to take place? I’d be totally fine with that.
So it would appear that something I’m doing in each update is changing this hash. So before updating the next mobile apps and stuff, I have to ensure this hash doesn’t change. I’m not changing ANY packages, but some how, this hash must be changed. I wonder if I can force it…
NICE. You can totally over ride this. So if this infact a known Meteor bug, this is the work around!
You may want to override the compatibility version if you want hot code push to reach older apps that don’t have the latest version of your native code from the app store. Let’s say you’re developing an iOS app, you have the plugin cordova-plugin-camera@2.4.0, and your app has the compatibility version pictured above, 3ed5b9318b2916b595f7721759ead4d708dfbd46. If you were to update to version 2.4.1 of cordova-plugin-camera, your server would generate a new compatibility version and your users’ apps would stop receiving hot code pushes. However, you can tell your server to use the old compatilibity version:
METEOR_CORDOVA_COMPAT_VERSION_IOS=3ed5b9318b2916b595f7721759ead4d708dfbd46 meteor run ios-device
How should one use METEOR_CORDOVA_COMPAT_VERSION_IOS and METEOR_CORDOVA_COMPAT_VERSION_ANDROID in combination with Meteor up?
Is it enough to build an .apk and use these variables in the build command?
I suppose the two environmental variables also need to be bundled in the server upload, since they are accessible at Meteor.AbsoluteUrl("/__cordova/manifest.json"). Are both necessary?
Yes both are explicitly necessary, as described by the official Meteor docs.
Again - make sure your web, ios, android and desktop apps are built on the SAME computer.
Specifically regarding your question, it should be enough to declare these variables in the build command. I have mine set to globals, and am not messing with it for the next while - but it should work, yep!
NOTE: I like to do on Windows %%METEOR_CORDOVA_COMPAT_VERSION_IOS%% in a command prompt, that should spit out your version. If it does, good. If not, you’re still not even close to correctly setting up your enviro variables.
Mac and Linux were pretty weirdo to set them up. Keep digging.