-
Notifications
You must be signed in to change notification settings - Fork 467
CHCP reload index.html page on screen wake #93
Comments
My guess that this is on Android? |
yes, is this a known issue? |
Thanks for noticing, will fix that. |
The reason it reload everytime on wake is on line 115 it redirect to index.html in the onStart function which will be called everytime on screen wake |
Yes, that is correct. Found it when posted the first answer. But thanks for the help :) Will add check, that if we already loaded correct index page - don't do it again. |
@nikDemyankov I noticed that the app is reloaded on every resume (on Android, haven't tested on iOS), even if I set {"update": "start"} in chcp.json. I'm wondering if this is affected by the same code you've mentioned. |
@johnmiroki yes, it doesn't depend on the chcp.json configuration. Page just get's reloaded, when application is awaken. Should be fine on iOS. |
@nikDemyankov I see. Thanks! Good to know it's gonna be fixed on next version bump. chcp.json.update only controls when the downloaded update actually replaces the old file. When the plugin checks for an update or reload the page is another story. right? |
@johnmiroki yes, chcp.json.update controls, when plugin installs the update. The reload problem, described in this issue, is just a bug, which is not related to that preference. |
@johnmiroki I added a check in my fork to only reload page during app start or app update |
@sckoh Thanks a lot. Just tried on one android device quickly, the plugin doesn't reload the app on every resume any more at the very least. consider a pull-request? |
@sckoh good one :) Thanks for sharing. But I should say, that it will not work properly for the update, that happens on the very first start. When application launched for the first time (or after being updated from the store) - it will exit on line 112. So the reload flag is |
There is a bug with your fix (taken from app with the recent master branch of your plugin):
It seems webView.getUrl() is null... |
@alexbuijs Thanks for noticing. Strange that I didn't hit that. Are you using crosswalk or something like that? |
Yes, I am using crosswalk. Does that impact this plugin? |
Not so long ago I had a similar problem with crosswalk: in onStart() it didn't have any URL in the webView, although the default webView did. That's why I missed that in this fix: haven't checked it with crosswalk. But when you showed the crash log - it hit me. Will test it more with the crosswalk. |
Awesome! Thanks for all your work on this great plugin! :-) |
Thanks :) |
Just encountered this bug when playing with the camera on an Android device. After the photo is taken or picked in the library, the app is resumed and index.html reloaded, which makes processing the pic impossible. |
Wanted to cleanup the fix a bit before the actual release. Probably will do this during the weekends, or on Monday. |
I don't know if it's related but :
After I removed the plugin and reinstalled 1.2.4, it worked again. I hope it helps. |
Yes, thanks. Didn't test it properly, so this is possible. That's why it is still not released. |
v1.2.5 is released. Should work now. |
CHCP reload the index.html page everytime i turn off screen and turn it back.
the log show:
D/CHCP﹕ Loading external page: /data/user/0/com.example.package/files/cordova-hot-code-push-plugin/2016-01-18T09:33:25.621Z/www/index.html
The text was updated successfully, but these errors were encountered: