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

Download version directly from the web/S3 #111

Closed
nimshkedy opened this issue Feb 28, 2016 · 5 comments
Closed

Download version directly from the web/S3 #111

nimshkedy opened this issue Feb 28, 2016 · 5 comments

Comments

@nimshkedy
Copy link

We are porting CHCP for use in our SDK

We plan to implement the following features:

  • Allow CHCP to work without initial assets (download directly from web/S3) - by adding a install-from-assets flag in the XML
  • In case install-from-assets flag is false: override copyAssetDirectoryToAppDirectory with createStubAppDirectory (creates a stub directory on disk with empty config and manifest and then continues to update as usual)
  • Add a auto-redirect-to-index-page flag to config.xml (allows to disable the redirect if we prefer to keep the old version running)
@nikDemyankov
Copy link
Member

That's interesting :)

Can you explain a bit more about auto-redirect-to-index-page? When is it used? If in conjunction with install-from-assets, then if it set to false - you can't redirect to the stubbed folder. When this is true - you, probably, should redirect to it (and you will on the next app launch). In all other cases - if you are not redirecting to index page in the updated folder - you'r not gonna see the update...

Regarding install-from-assets - you will have to install them on the first application update. But yes, you can use this flag for the first launch or after application update from the store.

@nimshkedy
Copy link
Author

Thanks for asking. In our scenario we are using CHCP to push UI code to our SDK inside a host app built and deployed to the store by our client.

This means the following changes:

  • We don't control the assets folder at all - can't place any files there and can't expect files to be there.
  • We also prefer to control the hot patch flow: when it will start, whether it will install the newly downloaded version and whether it will replace the view currently displayed to the user.
  • We can't have a splash screen while inside a host app. Whenever our SDK is called upon, we need it to run immediately with whatever UI version it currently has. And we can't interrupt/reload the UI while the user is viewing it.

We are still making drafts for the new design & will update soon :)

@nikDemyankov
Copy link
Member

So, you are planning to use CHCP to update components in your SDK. And the client is using SDK to construct UI on his web page. Is this correct?

If yes, then probably the easiest way would be to fork the plugin, and then change HCPPlugin class for iOS and HotCodePushPlugin.java class for Android. In these classes you will need to remove assets installation and page reload (as you said), plus add some SDK-specific logic.

Also, change the path, where the updated files are stored. Should be quite simple, since it's this and this classes.

And maybe extend JS interface with your SDK components.

If what you are building is SDK, then you must think, that client would want to install CHCP plugin in order to update his codebase. So you need to separate them...

@nikDemyankov
Copy link
Member

But it is an interesting usage of the plugin :)

@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.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants