<feature>

feature

If you use the CLI to build applications, you use the plugin command to enable device APIs. This does not modify the top-level config.xml file, so the element does not apply to your workflow. If you work directly in an SDK and using the platform-specific config.xml file as source, you use the tag to enable device-level APIs and external plugins. They often appear with custom values in platform-specific config.xml files. See the API Reference for details on how to specify each feature. See the Plugin Development Guide for more information on plugins. NOTE: Most of the time, you do NOT want to set this directly.

Attributes(type)
Only for platform:
Description
name(string) Required
The name of the plugin to enable.

param

Used to specify what certain plugin parameters such as: what package to retrieve the plugin code from, and whether the plugin code is to be initialized during the Webview's initialization.

Attributes(type)
Only for platform:
Description
name(string)
iOSOS XAndroid
Required
Allowed values: android-package, ios-package, osx-package, onload.
'ios-package', 'osx-package' and 'android-package' are used to specify the name of the package (as specified by the 'value' attribute) to be used to initialize the plugin code, while 'onload' is used to specify whether the corresponding plugin (as specified in the 'value' attribute) is to be instantiated when the controller is initialized.
value(string or boolean)
iOSOS XAndroid
Required
Specifies the name of the package to be used to initialize the plugin code (when the 'name' attribute is android-package, ios-package or osx-package), specifies the name of the plugin to be loaded during controller initialization (when 'name' attribute is set to 'onload').

Examples:

<!-- Here is how to specify the Device API for Android projects -->
<feature name="Device">
   <param name="android-package" value="org.apache.cordova.device.Device" />
</feature>

<!-- Here's how the element appears for iOS projects -->
<feature name="Device">
   <param name="ios-package" value="CDVDevice" />
   <param name="onload" value="true" />
</feature>

<!-- Here's how the element appears for OS X projects -->
<feature name="Device">
   <param name="osx-package" value="CDVDevice" />
   <param name="onload" value="true" />
</feature>
doc_cordova
2017-01-31 03:39:49
Comments
Leave a Comment

Please login to continue.