the app works just fine (browser and Cordova), shows the latest version of the UI and communicate with server as expected. If I push new code, browser clients get updated, not so much for Cordova ones…
I’m aware there have been many issues regarding HCP posted on this forum, and that development is active on this particular subject (thanks @martijnwalraven), but I have not found one where it stopped working after deployment, or the requirements for setting it up correctly on my particular hosting (I’ve contacted them already, they’re awesome and very reactive, but unfortunately they could not give me an answer).
ROOT_URL is set correctly on target host.
I use --mobile-settings option to build the app.
I suspect the issue is that ROOT_URL has not been set correctly on the server. Could you check the value of __meteor_runtime_config__ in the generated index.html?
So it seems that although the ROOT_URL has been set correctly, it is somehow not serving the Cordova version. Did you remove the mobile platforms from your app by any chance?
This is the output on my local dev machine. I could not run it on the server (command not found).
I’m using iron-cli to scaffold my app and run the local server (I don’t think it’s relevant, it’s basically passing the build and run commands along to meteor), so the meteor app has it’s own folder /app.
Details about deploying meteor on scalingo can be found here :
Like explained here, app folder needs to be specified setting PROJECT_DIR in host environment.
Basically,I just push my local branch, the container gets restarted, and I can see the expected behaviour in a browser tab, updated with new code.
I can’t tell when or why __meteor_runtime_config__.autoupdateVersionCordova gets overwritten.
I’m Scalingo’s CTO,maybe I’ll be able to give you a little more insight about our build process. Currently, we do not build to the ‘android’ and ‘ios’ targets. Once built, the programs directory looks like the following:
bundle/programs $ ls
server web.browser
It makes no sens for us to build the ios and android targets as we’re only hosting the web part of the application. Does the ‘server’ target needs the ‘android’ target to be enabled to allow hot code push?
Hi @soulou, thanks for looking into this. The server target indeed needs to build the web.cordova architecture to be able to serve updated code to mobile clients.
I’m not sure about your workflow, but the easiest solution is probably to leave the ios and/or android targets in as part of the projects and use meteor build as usual.
If you want to dive in more into what is going on, see:
Actually, letting ios and android does not work for us, building the ios target requires a Mac OS environment to build this target and building the ‘android’ target requires a full Android SDK which is not available in our nodejs/meteor building environment.
For us the ideal solution would be to build the web.cordova architecture without building the full android application. (it has no sense for us to build an Android application on our web hosting platform )
I was wondering if you had some new information on the requirements for building for the web.cordova architecture without the hassle of hosting SDKs and system environments.
We’ve been talking about it internally, and we agree we need to find a solution for this. One option we discussed would be to allow adding a cordova-server-only platform. Another option might be to add a --server-only option to meteor build.
@blouze@soulou: In 1.3-beta.12, I’ve added a --server-only option to meteor build that doesn’t require the mobile SDKs to be installed on the build machine, but that will still build web.cordova when ios or android platforms have been added to the project.
Hey @martijnwalraven!
As a meteor-head, I want to thank you all at MDG for your hard work to bring us 1.3
I just upgraded my mobile app to find out if it would solve my previous problem.
I am able to get the HCP working with a published Cordova app built with --server option set on a locally running instance (I had to build the app first, and then run meteor with a target specified as pointed out here).
After deploying the app in production, I can see the same behaviour as before, web client gets refreshed, no cigar for Cordova.
Values for ROOT_URL is set alright in runtime config, I even get a value for autoupdateVersionCordova.