The front end implementation of Evergreen involves the Javascript logic that will check, download, install, and restart the app when changes are made.
Evergreen Steps
There are four steps to an evergreen update:
Check for updates, download the update, install the update, restart the app for the changes to take affect.
These can be automated, or even chained together or done in the background, however for this example each step will be done manually , allowing you to see each step and identify each part of the code that handles that particular step.There are several parts of this functionality, and we'll go into more detail on the parts in the following exampleso that you're able to easily see what is involved.
Evergreen Update Example
The following is a basic an example of Evergreen evergreen functionality within a BlinkMobile hybrid app.
...
Firstly, you can download a full example below, and then we'll go through each part.
Download an Evergreen "www" Example
The following ZIP file contains the "www" folder of the example app, including Evergreen functionality:
Explanation of the Code
Inside the ZIP you'll find a basic the "www" folder from our example Cordova app. The two files in particular we're interested in are the following:
index.html
The index.html file is a basic an example showing a HTML interface that will allow a user to click on a button to check for updates, download them, install them, and then restart the app.
Each element is HTML only, with some CSS styling. Depending on the framework you're using, ideally you will replace these with elements or components that match your look and feel.
js/update.js
The update.js file is the file that handles the actual functionality.
...
You will need to add your own values here.
APP_ID : The This is the app "id" you've set in your config.xml file
...
This is all you need to edit in this file.
Next Step
Creating Deploying an Evergreen Update