GithubHelp home page GithubHelp logo

Comments (20)

nikDemyankov avatar nikDemyankov commented on July 17, 2024

Are you using local development add-on, or you are testing with the real server?

from cordova-hot-code-push.

dongdh avatar dongdh commented on July 17, 2024

I am testing with real server, I have tried different configurations

  1. with auto-load set to true or false
  2. manually call fetch and install update
  3. different settings with start, resume and now

from cordova-hot-code-push.

nikDemyankov avatar nikDemyankov commented on July 17, 2024

Is it Cordova or Ionic project? And on what platform you are testing: iOS or Android?

from cordova-hot-code-push.

dongdh avatar dongdh commented on July 17, 2024

I tested on iOS only, I have some own code build between cordova and ionic. the update works after I restart app 2 times, seems its not applied before I manually restart the app.

from cordova-hot-code-push.

nikDemyankov avatar nikDemyankov commented on July 17, 2024

That's strange. Will try to reproduce that.

Just of curiosity: if you will try to use local development add-on - problem remains, or everything works? Let him do all the work. You can look into the docs on how to use it.

from cordova-hot-code-push.

dongdh avatar dongdh commented on July 17, 2024

I set "update": "now" in chip.json, set in config.xml, reload index.html when updateInstalled event is triggered.
document.addEventListener('chcp_updateInstalled', function() {
document.location.href = 'index.html?var='+new Date().getTime();
}, false);
I need to manually close the app, and start it again to get the effect of the new change. maybe this is the way it intends to work.

A question would be is it possible to apply the change directly, or restart the app automatically, (what I did to restart is just reload index.html, maybe its not enough.)

from cordova-hot-code-push.

dongdh avatar dongdh commented on July 17, 2024

the change I did is just a very minor text change on one of the ionic page template.

from cordova-hot-code-push.

nikDemyankov avatar nikDemyankov commented on July 17, 2024

Well, it should reload the page automatically when the update is installed. But for some weird reason, in your case, it doesn't... Will investigate.

from cordova-hot-code-push.

dongdh avatar dongdh commented on July 17, 2024

I tried both iOS emulator and IOS phone, I run 8.4
Here id my config.xml that has to do with chcp







my chcp.json
{
"name": "xxxx",
"s3bucket": "xxxxx",
"s3region": "eu-west-1",
"ios_identifier": "id123456789",
"android_identifier": "xx.xxx.xxxx",
"update": "now",
"content_url": "xxxxxxxxx",
"release": "2015.11.27-15.25.57"
}

from cordova-hot-code-push.

dongdh avatar dongdh commented on July 17, 2024

Can someone guide me what is the correct configuration if expect app to reload with new update without manually restart app?

from cordova-hot-code-push.

dongdh avatar dongdh commented on July 17, 2024

Hello, I am looking through some code and try to understand, can you give me a guide on where the app is reloaded after installation success? do you restart the web view or? I was thinking if there is some cache involved when do a refresh of the url in cordova.

from cordova-hot-code-push.

dongdh avatar dongdh commented on July 17, 2024

Ok, found where it reloads the page.

from cordova-hot-code-push.

dongdh avatar dongdh commented on July 17, 2024

Tested some more, it seem the file in Library/Application support is updated, but in the running instance of the app, it still loads the old file.

from cordova-hot-code-push.

dongdh avatar dongdh commented on July 17, 2024

I read somewhere iOS has trouble clean cache for web view for local html. this doesn't sounds good:(

from cordova-hot-code-push.

dongdh avatar dongdh commented on July 17, 2024

http://stackoverflow.com/questions/2523435/how-to-clear-uiwebview-cache

don't know if this link helps, but it does seem there are no really good solution to this...

from cordova-hot-code-push.

dongdh avatar dongdh commented on July 17, 2024

Well, I am temporary solving it by always load js and html with timestamps, but it will be really nice if somehow the web view cache can be totally cleaned.

from cordova-hot-code-push.

tmchng avatar tmchng commented on July 17, 2024

+1 I also encountered the same problem.

Steps:

  1. Create a mock server serving www using http-server
  2. Deploy the same www content onto an emulator. Now the server and device have the same content
  3. Make an edit in www. Generate new config/manifest without deploying
  4. Try relaunching the app on emulator. I had to do it twice before I saw the change

from cordova-hot-code-push.

dongdh avatar dongdh commented on July 17, 2024

I think the problem is based on all js, css, img resources is still cached when you reload web view, so a workaround will be always load resources with timestamp. example src="xxxx.js?23948uioew098"

If you are using requirejs, there is a parameter you can set in config that always load files with an extra param,

from cordova-hot-code-push.

nikDemyankov avatar nikDemyankov commented on July 17, 2024

Yes, the problem is with iOS and how WebView caches css and js files. I use one dirty hack to solve it, it worked before. But for some reason it's not working for you... As a workaround - yes, you can add some random query parameter to the js and css files, as you showed.

I read http://stackoverflow.com/questions/2523435/how-to-clear-uiwebview-cache before, tried hacks from there, but didn't really helped.

Will continue to search for better solution on that.

from cordova-hot-code-push.

nikDemyankov avatar nikDemyankov commented on July 17, 2024

In v1.2.0 I have changed the way on how web files are stored. Now each release has it's own www folder. Because of that after the update css files will have a new absolute path, and WebView will use the new version, instead of the cached one. As a result - no need for timestamp hack in the file path.

from cordova-hot-code-push.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.