To install the Usage plugin, use the Cordova command line interface.
Prerequisites
Set up the development environment.
Create your Cordova project.
Add your OS platforms.
Note When SAP HCP, mobile service for development and operations is part of the
landscape, and the application is configured on
SAP HCP, mobile service for development and operations to collect client usage data, SAP Fiori
Client is already configured to initialize the Usage plugin. A default random
encryption key is used to encrypt the database containing usage records
on-device.
Procedure
Add the Usage plugin by entering the following at the command prompt, or
terminal:
cordova plugin add kapsel-plugin-usage --searchpath
KAPSEL_HOME/plugins
Note KAPSEL_HOME=C:\SAP\MobileSDK3\KapselSDK .
Add Logon plugin to your project.
Note The Usage plugin initializes automatically after Logon plugin registration. Once
registration is complete, the usage plugin requests user consent before
collecting usage information.
cordova plugin add kapsel-plugin-logon
(Optional) To see a list of installed plugins in your Cordova project, open a command
prompt or terminal window, navigate to your Cordova project folder, and enter: cordova plugins
The Cordova command line interface returns a JSON array showing installed plugins, for
example:
[ 'org.apache.cordova.core.camera',
'org.apache.cordova.core.device-motion',
'org.apache.cordova.core.file' ]
This
example shows that the Cordova project has the Cordova core Camera,
Accelerator (device-motion), and File plugins installed.
Modify the files in the Cordova project's www folder as
appropriate for your project.
Execute the following command to copy the files in the Cordova project's
www folder to the platform directories:
cordova prepare android
cordova prepare ios
cordova prepare windows
Use an integrated development environment to deploy and run the project.
Note If you are using an iOS device, ensure to add the "clienthubEntitlements" to the Keychain
Groups in the Entitlement section in Xcode.