For up-to-date product documentation, see the IBM MobileFirst Foundation Developer Center.


The Cordova configuration file

The Cordova config.xml file is the global configuration file of the application.

The Cordova configuration file is a mandatory XML file that contains application metadata, and is stored in the root directory of the app. The file is automatically generated when you create a Cordova application. We can then modify it to add custom properties.

We can find more general information about this file in the Apache Cordova config.xml documentation.

To know more about any MobileFirst-specific configuration, refer to the following sections.


Structure of the config.xml file

To view detailed information about any MobileFirst-specific configuration, click the element name in the file description, or in the alphabetical list that follows the description.

<?xml version='1.0'encoding='utf-8'?> <widget> <name>...</name> <description>...</description> <author>...</author> <content/> <plugin/> <access/> <allow-intent/> <platform> <allow-intent/> <icon/> <splash/> <update/> </platform> <mfp:platformVersion>...</mfp:platformVersion> <mfp:directUpdateAuthenticityPublicKey>...</mfp:directUpdateAuthenticityPublicKey> <mfp:languagePreferences>...</mfp:languagePreferences> <mfp:clientCustomInit/> <mfp:server/> <mfp:ios> <mfp:appChecksum>...</mfp:appChecksum> <mfp:sdkChecksum>...</mfp:sdkChecksum> <mfp:security> <mfp:testWebResourcesChecksum/> </mfp:security> </mfp:ios> <mfp:android> <mfp:appChecksum>...</mfp:appChecksum> <mfp:sdkChecksum>...</mfp:sdkChecksum> <mfp:security> <mfp:testWebResourcesChecksum/> </mfp:security> </mfp:android> <mfp:windows> <mfp:appChecksum>...</mfp:appChecksum> <mfp:windowsphone8> <mfp:sdkChecksum>...</mfp:sdkChecksum> <mfp:security> <mfp:testWebResourcesChecksum/> </mfp:security> </mfp:windowsphone8> <mfp:windows8> <mfp:sdkChecksum>...</mfp:sdkChecksum> <mfp:security> <mfp:testWebResourcesChecksum/> </mfp:security> </mfp:windows8> <mfp:windows10> <mfp:sdkChecksum>...</mfp:sdkChecksum> <mfp:security> <mfp:testWebResourcesChecksum/> </mfp:security> </mfp:windows10> </mfp:windows> </widget>


config.xml elements


<widget>

Syntax

<widget id="my.mfp.cordova.with.push.plugin" version="1.0.5" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0" xmlns:mfp="http://www.ibm.com/mobilefirst/cordova-plugin-mfp"> ... </widget>

Description
See the Apache Cordova config.xml documentation.
MobileFirst-specific attributes

  • id: This is the application package name that was specified when the Cordova project was created. If this value is manually changed after the application was registered with the MobileFirst Server, then the application must be registered again.
  • xmlns:mfp: Required. Set by default. It is the MobileFirst plug-in XML namespace.

Back to top


<mfp:platformVersion>

Syntax

<mfp:platformVersion>8.0.0.00.20160205-2039</mfp:platformVersion>

Contained in
<widget>
Configuration
Set by default. Must not be changed.
Description
Required. The product version on which the application was developed.

Back to top


<mfp:directUpdateAuthenticityPublicKey>

Syntax

<mfp:directUpdateAuthenticityPublicKey>public_key_string</mfp:directUpdateAuthenticityPublicKey>

Contained in
<widget>
Configuration
Set with the mfpdev app config direct_update_authenticity_public_key <value> command.

For more details about themfpdev app config command, type mfpdev help app config in your command window.

Description
Optional. When we enable the Direct Update Authenticity feature, the direct update package is digitally signed during deployment. After the client downloaded the package, a security check is run to validate the package authenticity. This string value is the public key that will be used to authenticate the direct update .zip file. For more information, see Implementing secure Direct Update on the client side.

Note: This element value is only supported by the platforms that support direct update: Cordova iOS and Cordova Android.

Back to top


<mfp:languagePreferences>

Syntax

<mfp:languagePreferences>en</mfp:languagePreferences>

Contained in
<widget>
Configuration
Set with the mfpdev app config language_preferences <value> command.

For more details about the mfpdev app config command, type mfpdev help app config in your command window.

Description
Optional. Contains a comma-separated list of locales to display system messages.

Back to top


<mfp:clientCustomInit>

Syntax

<mfp:clientCustomInit enabled="false"/>

Contained in
<widget>
Configuration
Edited manually. We can set the enabled attribute value to either true or false.
Description
Controls how the WL.Client.init method is called. By default, this value is set to false and the WL.Client.init method is automatically called after the MobileFirst plug-in is initialized. Set this value to true for the client code to explicitly control when WL.Client.init is called.
Attributes

  • enabled: Valid values are true and false.

Back to top


<mfp:server>

Syntax

<mfp:server url="http://10.0.0.1:9080" runtime="mfp" />

Contained in
<widget>
Configuration

  • The server url value is set with the mfpdev app config server command.
  • The server runtime value is set with the mfpdev app config runtime command.

For more details about the mfpdev app config command, type mfpdev help app config in your command window.

Description
Default remote server connection information, which the client application uses to communicate with the MobileFirst Server.
Attributes

  • url: The url value specifies the MobileFirst Server protocol, host, and port values that the client will use to connect to the server by default.
  • runtime: The runtime value specifies the MobileFirst Server runtime to which the application was registered. For more information about the MobileFirst runtime, see MobileFirst Server overview.

Back to top


<mfp:ios>

Syntax

<mfp:ios> <mfp:appChecksum>...</mfp:appChecksum> <mfp:sdkChecksum>...</mfp:sdkChecksum> <mfp:security> <mfp:testWebResourcesChecksum/> </mfp:security> </mfp:ios>

Contained in
<widget>
Contains

Description
This element contains all MobileFirst-related client application configuration for the iOS platform.

Back to top


<mfp:android>

Syntax

<mfp:android <mfp:appChecksum>...</mfp:appChecksum> <mfp:sdkChecksum>...</mfp:sdkChecksum> <mfp:security> <mfp:testWebResourcesChecksum/> </mfp:security> </mfp:android>

Contained in
<widget>
Contains

Description
This element contains all MobileFirst-related client application configuration for the Android platform.

Back to top


<mfp:windows>

Syntax

<mfp:windows> <mfp:appChecksum>...</mfp:appChecksum> <mfp:windowsphone8> <mfp:sdkChecksum>...</mfp:sdkChecksum> <mfp:security> <mfp:testWebResourcesChecksum/> </mfp:security> </mfp:windowsphone8> <mfp:windows8> <mfp:sdkChecksum>...</mfp:sdkChecksum> <mfp:security> <mfp:testWebResourcesChecksum/> </mfp:security> </mfp:windows8> <mfp:windows10> <mfp:sdkChecksum>...</mfp:sdkChecksum> <mfp:security> <mfp:testWebResourcesChecksum/> </mfp:security> </mfp:windows10> </mfp:windows>

Contained in
<widget>
Contains

Description

This element contains all MobileFirst-related client application configuration for the Windows platforms.

Back to top


<mfp:windows8>

Syntax

<mfp:windows8> <mfp:sdkChecksum>...</mfp:sdkChecksum> <mfp:security> <mfp:testWebResourcesChecksum/> </mfp:security> </mfp:windows8>

Contained in
<mfp:windows>
Contains

Description
This element contains all MobileFirst-related client application configuration for Windows 8.1 platforms.

Note: Windows Phone 8.1 configuration is contained under the <mfp:windowsphone8> element.

Back to top


<mfp:windowsphone>

Syntax

<mfp:windowsphone8> <mfp:sdkChecksum>...</mfp:sdkChecksum> <mfp:security> <mfp:testWebResourcesChecksum/> </mfp:security> </mfp:windowsphone8>

Contained in
<mfp:windows>
Contains

Description
This element contains all MobileFirst-related client application configuration for the Windows Phone 8.1 platform.

Back to top


<mfp:windows10>

Syntax

<mfp:windows10> <mfp:sdkChecksum>...</mfp:sdkChecksum> <mfp:security> <mfp:testWebResourcesChecksum/> </mfp:security> </mfp:windows10>

Contained in
<mfp:windows>
Contains

Description

This element contains all MobileFirst-related client application configuration for Windows 10 Universal Windows Platform (UWP).

Back to top


<mfp:appChecksum>

Syntax

<mfp:appChecksum>1234567890</mfp:appChecksum>

Contained in
<mfp:ios>, <mfp:android>, and <mfp:windows>.
Configuration
Not user-configurable. The checksum value is updated when the mfpdev app webupdate command is run.

For more details about the mfpdev app webupdate command, type mfpdev help app webupdate in your command window.

Description
This value is the checksum of application web resources. It is calculated when mfpdev app webupdate is run.

Back to top


<mfp:sdkChecksum>

Syntax

<mfp:sdkChecksum>2101152546</mfp:sdkChecksum>

Contained in
<mfp:ios>, <mfp:android>, <mfp:windowsphone8>, <mfp:windows8>, and <mfp:windows10>.
Configuration
Not user-configurable. This value is set by default.
Description
This value is the IBM MobileFirstâ„¢ Platform SDK checksum that is used to identify unique IBM MobileFirst Platform SDK levels.

Back to top


<mfp:security>

Syntax

<mfp:security> <mfp:testWebResourcesChecksum enabled="false" ignoreFileExtensions="png, jpg, jpeg, gif, mp4, mp3/> </mfp:security>

Contained in
<mfp:ios>, <mfp:android>, <mfp:windowsphone8>, <mfp:windows8>, and <mfp:windows10>.
Contains
<mfp:testWebResourcesChecksum/>
Description

This element contains the client application's platform-specific configuration for MobileFirst security.

Back to top


<mfp:testWebResourcesChecksum>

Syntax

<mfp:testWebResourcesChecksum enabled="false" ignoreFileExtensions="png, jpg, jpeg, gif, mp4, mp3"/>

Contained in
<mfp:security>
Configuration

  • The enabled attribute is set with the mfpdev app config android_security_test_web_resources_checksum <value> command.
  • The ignoreFileExtensions attribute is set with the mfpdev app config android_security_ignore_file_extensions <value> command.

For more details about the mfpdev app config command, type mfpdev help app config in your command window.

Description
Controls whether the application verifies the integrity of its web resources each time it starts running on the mobile device.
Attributes

  • enabled: Valid values are true and false. If this attribute is set to true, the application calculates the checksum of its web resources and compares this checksum with a value that was stored when the application was first run.
  • ignoreFileExtensions: Checksum calculation can take a few seconds, depending on the size of the web resources. To make it faster, we can provide a list of file extensions to be ignored in this calculation. This value is ignored when the enabled attribute value is false.

Back to top

Parent topic: Inside your Cordova app