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

When Will Plugin Phone Home? #86

Closed
johnmiroki opened this issue Jan 13, 2016 · 5 comments
Closed

When Will Plugin Phone Home? #86

johnmiroki opened this issue Jan 13, 2016 · 5 comments

Comments

@johnmiroki
Copy link

Hi, I got the plugin working on both Android and iOS. I have but one quick question: how is the "phone home" behavior configured? ie, how often does the plugin attempt to download chcp.json, or put it another way, what triggers the download?
I've noticed that on Android, it seems the plugin phones home on "resume" or start; on iOS, it will only phone home on fresh start. Is it supposed to work this way? Is there anyway to configure it?
I'd appreciate your insight.

@nikDemyankov
Copy link
Member

Hi,

Both for Android and iOS it checks for update only on the fresh start when web page is initialised. When on Android you press "back" button - it sort of kills the app. That's why it executes the check once again on the launch.

I can make plugin to "call home" on every "resume" event both for Android and iOS. But you can do this manually from the JS side by calling "chcp.fetchUpdate" on every resume event:

document.addEventListener("resume", onResume, false);

function onResume() {
    chcp.fetchUpdate();
}

@johnmiroki
Copy link
Author

very insightful, thanks a lot!

@lorenzyannick
Copy link

@johnmiroki
This is what I do (fecth on JS side)
works perfectly, but there is a blink because after fetch + update the plugin refresh (normal)
So you need to block UI during install phase or provide a tool to confirm on user side to prevent refresh/blink that pertub the user.

@nikDemyankov : another thing could be :
add an option like the update one (resume, start, now) https://github.com/nordnet/cordova-hot-code-push#update to refresh without JS fetch code

@nikDemyankov
Copy link
Member

@lorenzyannick good point, this can be added.

@nordnet-deprecation-bot
Copy link
Contributor

👋 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.

@nordnet nordnet locked and limited conversation to collaborators Sep 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants