The AppUpdate plugin updates the contents of the www folder of deployed Kapsel
applications. After an application successfully does a logon to an SAP Mobile Platform 3
server, the AppUpdate plugin is able to download an available update. See Uploading Hybrid Apps in user documentation
for information on how to upload an update to SAP Mobile Platform 3 server.
After an update is completely downloaded, the application user is
prompted to install the update and restart the application. They can decline
if they wish.
Once an update is installed, the application's revision number is updated.
Adding and Removing the AppUpdate Plugin
The AppUpdate plugin is added and removed using the
Cordova CLI.
To add the AppUpdate plugin to your project, use the following command:
cordova plugin add <path to directory containing Kapsel plugins>\appupdate
To remove the AppUpdate plugin from your project, use the following command:
cordova plugin rm com.sap.mp.cordova.plugins.appupdate
Hybrid App Revision Preference
This is an optional preference that tells the AppUdate plugin if the local
assets are uploaded to the server, and at what number. If this preference is
not provided, the default revision is 0.
In your config.xml file you can add the following preference:
<preference name="hybridapprevision" value="1" />
This means that the local assets in your www folder are uploaded to the server
and the server is reporting revision 1 for them. This allows the application
to receive a delta update when revision 2 is available instead of a full update.
Caveats
It is important to test that your update has valid HTML, Javascript, and CSS.
Otherwise, the update could prevent the application from functioning correctly,
and may no longer be updateable. You can test the updated application in a
separate simulator or additional test device. You can also validate your
Javascript with tools like
JSLint, or
JSHint.
You can validate CSS with
CSS Lint.