Skip to content
This repository has been archived by the owner on Oct 1, 2018. It is now read-only.

The app will instant update, not able to control manually #115

Closed
maplerichie opened this issue Mar 10, 2016 · 6 comments
Closed

The app will instant update, not able to control manually #115

maplerichie opened this issue Mar 10, 2016 · 6 comments

Comments

@maplerichie
Copy link

document.addEventListener('chcp_updateIsReadyToInstall', this.hello, false);
hello: function(){
//Display a message, click ok to check for update
//gap.checkForUpdate();
}
The app will auto update and refresh instantly
The local server had set as:
"update": "resume",
Any method to track the progress of downloading?
Actually i wish to do in this way but try several times also can't do it

  1. Check update on init
  2. No, continue without prompt: Yes, show preloader (downloading progress)
  3. Once download ready, prompt message "Application updating"
  4. Click OK to restart application

Sorry for the trouble.
Thanks

LK

@nikDemyankov
Copy link
Member

Did you set auto-install and auto-download properties to false in your config.xml (documentation)? This should disable plugin from automatically downloading and installing updates.

Check update on init

At the moment there is no method to just check, if new release is available for download. Since it is executed in the background - you don't really need to force user to wait for it, and then again - ask for installation. You can just download it, and only then ask for installation permission.

To check, if new release was loaded and available for installation I am planning to add new JS method: #102 .

For now you'll have to capture chcp_updateIsReadyToInstall event and store a flag in local storage, that update is loaded and can be installed. This way you can ask user's permission on the next app launch.

@maplerichie
Copy link
Author

I do set both to enabled="false"

<config-file url="https://localhost:31284/chcp.json"/>
<local-development enabled="true"/>
<auto-download enabled="false"/>
<auto-install enabled="false"/>

But the code seem like doesn't work correctly.

Is it affected by the chcp.json under /www
"update": "now",
This value is now by default? If i change to resume, it will change to now when build apk
Is it the problem of local server and local hot code push plugin?

I also try to set a flag using chcp_updateIsReadyToInstall, but it seem like auto download and update, refresh application.

Can i request an enhancement in future? Implement updating progress 0% to 100% indicator, this can prevent user to quit app or switch app into background when the app loading long time for downloading update.

Thanks for your instant reply.

@nikDemyankov
Copy link
Member

Okey, you are using local development plugin. You need to either remove it or disable it, if you want to test manual update handling. When application launched - he is connecting via socket to the local server and listens for project files updates. When you change something - he fetches update from the server.

Regarding progress bar: of course, but this is not gonna be implemented soon since there is a lot of other stuff laying around in the issues list...

@maplerichie
Copy link
Author

Understand. Thank you very much

@nikDemyankov
Copy link
Member

Hope it will resolve the problem you have :) If so - let me know and I'll close the issue.

@maplerichie
Copy link
Author

Thanks! Keep in view

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants