If screen is off when files are downloading,the update will error.
Closed this issue · 7 comments
Hi, I find eventbus cannt receive events if screen is off, but sometimes downloading files need long time. Whether eventbus unregister in onDestory is better then onStop? I
m Sorry ,my English is very poor.
Hi,
Sorry for the late reply...
If download has started - it will continue until app is killed or work is done, since it is executed in a separate thread. When you will resume the app - plugin should trigger the installation process (depending on it's configuration), or you can do it yourself from the JS side. So, not sure, that unsubscribing should be done on onDestroy
event. If app is not used by the user - it should reduce it's activity, if possible. That's why it's unsubscribing in onStop
.
Thank you for your answer.
Hello, I have another problem. I have updated Ionic
to Ionic2
, you konw the the structure of ionic2
has changed. I have followed some ways to save "chcp.json"
and "chcp.manifest"
to "src"
folder, and override the copy.config.js
to copy files to "www"
folder. When I run cordova-hcp build src/assets
, the content in "chcp.manifest"
like this:
[
{
"file": "icon/favicon.ico",
"hash": "0350f4b3a2067110b1e642ee5931a38a"
},
{
"file": "img/headimg.jpg",
"hash": "a2ca2033954ace3662040d0c06ff621e"
},
{
"file": "img/oliver.jpg",
"hash": "4336c2f898db3ca69be70a61527a3f04"
}
]
This is not I want. I hope the content in chcp.manifest
is based on files in 'www' folder . how to solve it ? Thanks.
Hi,
It is similar to #234 . Didn't have time to figure out the proper solution. Planning to do that during the weekend.
But the idea is to write some Ionic hook, that will execute cordova-hcp build src
and then copy configs to PROJECT_NAME/www
folder before they are added to the native project. Or, maybe, copy them directly to the native project. Just need to experiment with that. But one of the above should work.
Thank you very much! I have solved it by add a hook, it work perfect ! I do it like this:
add a file in hooks;
hooks/before_prepare/cordova-hcp-build.js
:
#!/usr/bin/env node
function cordovaHcpBuild(){
var exec = require('child_process').exec;
console.log("start cordova-hcp build...");
var cmdStr = 'cordova-hcp build';
exec(cmdStr, function(err,stdout,stderr){
if(err) {
console.log('cordova-hcp build error:'+stderr);
} else {
console.log("cordova-hcp build complete:" + stdout);
}
});
}
cordovaHcpBuild();
Hope it can help someone.
Great, thanks for sharing :)
Although, I thought that problem is a bit more trickier, but as long as it works - that's enough :)
👋 Hi! Thank you for your interest in this repo.
😢 We are not using nordnet/cordova-hot-code-push anymore, and we lack the manpower and the experience needed to maintain it. We are aware of the inconveniece that this may cause you. Feel free to use it as is, or create your own fork.
🔒 This will now be closed & locked.
ℹ️ Please see #371 for more information.