Hi, someone know how I can disable hot-code-push only mobile ? Because I need enable only on web version.
Hmm, I don’t know if there’s a setting you can toggle. One idea you could try is before you build your mobile app, remove meteor-base, and then add back all base packages except hot-code-push.
They are: meteor, webapp, underscore, ddp
I will try too. This moment I will try add a new plugin that I dont use in server, and wait hot-code-push block update.
A doubt, if I remove hot-code-push, my client web dont updated automaticly too ?
Yeah, so you have to add it back after you build your mobile app.
You could make a build script that is like
meteor remove hot-code-push meteor build mobile... meteor add hot-code-push
Idon’t know if this is the best solution but it should work
It works fine. Thanks.
There’s a better solution for programmatically controlling HCP:
One usecase for this is to prevent HCP completely, e.g. on mobiles.
It also allows you to show a dialog before HCP takes place. But beware not to do this on iOS, since Apple‘s reviewer team doesn’t like these kind of dialogs.
I am using
Reload._onMigrate() to defer HCP on mobile devices until the app is restarted by the user. In the web browser, I am showing a dialog instead which allows the user to reload the app or cancel HCP if important work would be lost.
Would you like to publish this functionality as a package maybe? Sounds really tasty)
It’s quite tightly coupled to bootstrap modals to make it work. Not sure if that is really what other people would want, as many are moving to React now.
You could substitute custom modal for simple
window.confirm() as scaffolding; then other developers could plug in their preferred view component, but your logic would remain intact.