• This repository has been archived on 01/Oct/2018
  • Stars
    star
    980
  • Rank 46,713 (Top 1.0 %)
  • Language
    Java
  • License
    MIT License
  • Created over 9 years ago
  • Updated about 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

[DEPRECATED] - This plugin provides functionality to perform automatic updates of the web based content in your application.

THIS PROJECT IS DEPRECATED

We are not using this repo 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. See #371 for more information.

Cordova Hot Code Push Plugin

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:

  1. Publish new version of the app on the store. But it takes time, especially with the App Store.
  2. Sacrifice the offline feature and load all the pages online. But as soon as Internet connection goes down - application won't work.

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.

Supported platforms

  • Android 4.0.0 or above.
  • iOS 7.0 or above. Xcode 7 is required.

Installation

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:

  • easily generate necessary configuration files;
  • launch local server to listen for any changes in the web project and deploy new version immediately on the app.

Of course, you can use this plugin without the CLI client, but it will make your life easier.

Quick start guide

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.

  1. Create new Cordova project using command line interface and add iOS/Android platforms:
cordova create TestProject com.example.testproject TestProject
cd ./TestProject
cordova platform add android
cordova platform add ios

Or use the existing one.

  1. Add plugin:
cordova plugin add cordova-hot-code-push-plugin
  1. Add plugin for local development:
cordova plugin add cordova-hot-code-push-local-dev-addon
  1. Install Cordova Hot Code Push CLI client:
npm install -g cordova-hot-code-push-cli
  1. Start local server by executing:
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
  1. Open new console window, go to the project root and launch the app:
cordova run

Wait until application is launched for both platforms.

  1. Now open your 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>

Documentation

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.

More Repositories

1

cordova-universal-links-plugin

[DEPRECATED] - Cordova plugin to support Universal/Deep Links for iOS/Android.
JavaScript
349
star
2

cordova-hot-code-push-cli

[DEPRECATED] - This is a command line utility for Cordova Hot Code Push Plugin.
JavaScript
143
star
3

nordnet-ui-kit

Nordnet UI Kit
JavaScript
106
star
4

sass-variable-loader

Sass variable loader for webpack
JavaScript
97
star
5

next-api-v2-examples

Code examples for using the Nordnet External API v2
Python
57
star
6

python-freeipa-json

Tiny/basic module for communicating with the FreeIPA API without having to install the entire FreeIPA toolchain
Python
54
star
7

nordnet-next-api

Nordnet nExt API Javascript client
JavaScript
28
star
8

react-bem-grid

A BEM-ified port of Flexbox Grid to a simple, reusable React component
JavaScript
27
star
9

cordova-hot-code-push-local-dev-addon

[DEPRECATED] - Cordova plugin that adds local development feature to the Hot Code Push plugin.
Swift
24
star
10

nordnet-component-kit

Nordnet Component Kit - https://nordnet.github.io/nordnet-component-kit
JavaScript
13
star
11

react-svg-sprite-icon

A React icon component that generates an SVG sprite on the fly
JavaScript
7
star
12

grid

Grid System as a React component based on Flexbox Grid
JavaScript
6
star
13

frontend-mentorship

JavaScript
6
star
14

generator-nordnet-es-module

Scaffold out an ES6 node module
JavaScript
3
star
15

cz-conventional-changelog

conventional-changelog config for commitizen
JavaScript
2
star
16

eslint-config-nordnet

ESLint config for Nordnet Javascript applications
JavaScript
2
star
17

nordnet-release-plugin

Webpack plugin for building releases of Javascript applications
JavaScript
2
star
18

design-tokens

TypeScript
1
star
19

jscs-config-nordnet

JSCS config for Nordnet Javascript applications
JavaScript
1
star