Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
cordova-hot-code-push-plugin
Advanced tools
This plugin provides functionality to perform automatic updates of the web based content in your application. Basically, everything that is stored in www
folder of your Cordova project can be updated using this plugin.
When you publish your application on the store - you pack in it all your web content: html files, JavaScript code, images and so on. There are two ways how you can update it:
This plugin is intended to fix all that. When user starts the app for the first time - it copies all the web files onto the external storage. From this moment all pages are loaded from the external folder and not from the packed bundle. On every launch plugin connects to your server (with optional authentication, see fetchUpdate() below) and checks if the new version of web project is available for download. If so - it loads it on the device and installs on the next launch.
As a result, your application receives updates of the web content as soon as possible, and still can work in offline mode. Also, plugin allows you to specify dependency between the web release and the native version to make sure, that new release will work on the older versions of the application.
Is it fine with App Store? Yes, it is... as long as your content corresponds to what application is intended for and you don't ask user to click some button to update the web content. For more details please refer to this wiki page.
This requires cordova 5.0+ (current stable 1.5.3)
cordova plugin add cordova-hot-code-push-plugin
It is also possible to install via repo url directly (unstable)
cordova plugin add https://github.com/nordnet/cordova-hot-code-push.git
At the end of the installation plugin will recommend you to install Cordova Hot Code Push CLI client. This client will help you to:
Of course, you can use this plugin without the CLI client, but it will make your life easier.
In this guide we will show how quickly you can test this plugin and start using it for development. For that we will install development add-on.
cordova create TestProject com.example.testproject TestProject
cd ./TestProject
cordova platform add android
cordova platform add ios
Or use the existing one.
cordova plugin add cordova-hot-code-push-plugin
cordova plugin add cordova-hot-code-push-local-dev-addon
npm install -g cordova-hot-code-push-cli
cordova-hcp server
As a result you will see something like this:
Running server
Checking: /Cordova/TestProject/www
local_url http://localhost:31284
Warning: .chcpignore does not exist.
Build 2015.09.02-10.17.48 created in /Cordova/TestProject/www
cordova-hcp local server available at: http://localhost:31284
cordova-hcp public server available at: https://5027caf9.ngrok.com
cordova run
Wait until application is launched for both platforms.
index.html
page in www
folder of the TestProject
, change something in it and save. In a few seconds you will see updated page on the launched devices (emulators).From this point you can do local development, where all the changes are uploaded on the devices without the need to restart applications on every change you made.
For production build do not forget to add the following to your config.xml
file as it is a required property. Checkout the wiki for more information:
<chcp>
<config-file url="https://5027caf9.ngrok.com/chcp.json"/>
</chcp>
All documentation can be found in details in our Wiki on GitHub.
If you have some questions/problems/suggestions - don't hesitate to post a thread. If it's an actual issue - please, follow this guide on how to do that properly.
1.5.3 (2016-05-27)
Bug fixes:
Documentation:
FAQs
Cordova plugin to perform code updates on the fly
We found that cordova-hot-code-push-plugin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.