AirWatch Managed AppConfig Sample - Cordova

Cordova provides a number of plugins to fetch managed AppConfig on devices that are enrolled into an EMM provider, such as AirWatch. Oracle provides one such stable plugin and you can download it using NPM. These values are sent to the device using the MDM protocol. It's crucial that the app in question is configured correctly in the AirWatch Console so that it can leverage AppConfig. Review the prerequisites to use managed AppConfig for the Cordova platform.

  • Integrate a Cordova app with a plugin that invokes native managed AppConfig code on iOS and Android. You can also develop the app by manually writing the native managed AppConfig code as per Google's and Apple's guidelines.
  • Assign the Cordova app to an AirWatch enrolled device.
  • For Android, use Android for Work integration with AirWatch so that you can push this app either from your corporate Google Play Channel or from the Google Play Store.

 

Develop Applications That Support Managed AppConfig on Cordova

Add the EMM AppConfig plugin to your Cordova-based application:

cordova plugin add cordova-plugin-emm-app-config --save

 

Fetch the managed AppConfig parameters:

document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
     console.log(cordova.plugins.EmmAppConfig.getValue("keyName"));
}

 

See the sample app:

Locate the implementation of managed AppConfig in our Cordova AppConfig sample app in the AppConfigCordovaSample/www/js/index.js file.

 

Publish Managed AppConfig for Cordova-based iOS applications in AirWatch

Manually: An AirWatch administrator can push the managed AppConfig for their enterprise applications using the following steps:

  1. Under the Internal App Detail view select Assign
  2. Select the Smart Group and select Edit Assignment.
  3. Scroll down and enable App Configuration.
  4. Enter the key-value pairs required for the application. The key needs to match the key-value pairs programmed into the application by the developer.
  5. Save and Publish the changes.

Upload XML: An AirWatch administrator can push the managed AppConfig by uploading an XML file that contains the key-value pairs.

  1. Under the Internal App Detail view select Assign.
  2. Select the Smart Group and select Edit Assignment.
  3. Scroll down and enable App Configuration.
  4. Select Upload XML.
  5. Save and Publish the changes.

Note: This option was introduced in AirWatch 9.1. The XML schema should look like the following snippet. Replace the bundle ID with the bundle ID of your application and change the key-value pairs.

<managedAppConfiguration>
     <version>1</version>
     <bundleId>com.vmware.gss.AirWatchAppConfigSample</bundleId>
     <dict>
          <string keyName="awservername">
               <defaultValue>
                    <value>server.awmdm.com</value>
               </defaultValue>
          </string>
     </dict>
</managedAppConfiguration>

 

Publish Managed AppConfig for Cordova-based Android applications in AirWatch

An AirWatch administrator can  push the managed AppConfig for their enterprise applications using the following steps.

  1. Import the application from your Corporate Google Play Channel or from the Google Play Store by navigating to Apps > List View > Public > Add Application.
  2. Under the App Assignment section, enable Application Configuration.
  3. Enter the key-value pairs required for the application. The key needs to match the key-value pairs programmed into the application by the developer.
  4. Select Save and Publish.

 

An AirWatch administrator  can update the managed AppConfig for their enterprise applications using the following steps

  1. Update the values for the managed AppConfig keys by navigating to Edit Application > Assignment > Application Configuration.
  2. Select Save and Publish.
  3. Navigate to the App Details and select More > Send Application Configuration.
Have more questions? Submit a request

0 Comments

Article is closed for comments.