ArcGIS for Developers

ManagedAppConfiguration QML Type

(BETA) Provides access to EMM policy settings. More...

Import Statement: import ArcGIS.AppFramework.Management 1.0

Properties

Methods

  • object defaultValue(keyName)
  • object defaultValue(keyName, object valueIfKeyAbsent)
  • object value(keyName)
  • object value(keyName, bool returnDefault)
  • object value(keyName, bool returnDefault, object valueIfKeyAbsent)

Detailed Description

The ManagedAppConfiguration component provides an interface to allow Enterprise Mobility Management (EMM) software to overwrite certain provided default settings, allowing for streamlined app configuration across an enterprise. The component is a singleton, meaning that it does not need to be instantiated to be used.

For this component to function, your app needs a configurationSchema .xml file referenced in the app's appinfo.json. An example can be found at http://links.esri.com/appstudio/appconfigxmlexample.

Android also requires that a restriction file be referenced, the requirements of which can be found at https://developer.android.com/reference/android/content/RestrictionsManager.

The following code sample demonstrates a potential usage of ManagedAppConfiguration, using the policySettings property provided by the EMM software to overwrite a default portal URL and name provided in the configuration schema .xml.

Item {
        property bool isSupported:ManagedAppConfiguration.supported
        Connections {
                target: ManagedAppConfiguration

                onPolicySettingsChanged : {
                        console.log("supported: ", isSupported);
                        var appConfigDictionary = ManagedAppConfiguration.policySettings;
                        console.log("settings: ", JSON.stringify(appConfigDictionary));
                        for (var key in appConfigDictionary) {
                                console.log("Object item:", key, "=", appConfigDictionary[key]);
                                if (key === "portalUrl")
                                        portalUrl.text = appConfigDictionary["portalUrl"];
                                if (key === "portalName")
                                        portalName.text = appConfigDictionary["portalName"];
                        }
                        //json.text = JSON.stringify(appConfigDictionary);
                        settingsJson.text = JSON.stringify(ManagedAppConfiguration.policySettings, null, 2);

                }

                onPolicyDefaultsChanged : {
                        console.log("defaults changed: ", JSON.stringify(ManagedAppConfiguration.policyDefaults));
                }
        }
}

For more information on EMMs, including correct formatting of the required .xml files, see https://www.appconfig.org/ios/ for iOS and https://www.appconfig.org/android/ for Android.

Property Documentation

[read-only] error : string

Returns the last error encountered by the component.


[read-only] policyDefaults : object

Returns a JSON object containing every policy variable that can be controlled by the EMM, and its default value. These values and defaults are defined by the .xml file provided for the configurationSchema property in the app's appinfo.json file.


[read-only] policySettings : object

The policy settings to overwrite the policy defaults with. These are set by the EMM admin, and provided by the EMM system.


[read-only] supported : bool

Returns true if the overwriting of policy settings is supported by the operating system.

Typically, this property will return true on iOS and Android, and false on Windows, macOS and Linux. This is because most EMMs don't support app configurations on desktop platforms, although app distribution is supported on them.


Method Documentation

object defaultValue(keyName)

The keyName parameter


object defaultValue(keyName, object valueIfKeyAbsent)

The keyName parameter

The valueIfKeyAbsent parameter


object value(keyName)

The keyName parameter


object value(keyName, bool returnDefault)

The keyName parameter

The returnDefault parameter


object value(keyName, bool returnDefault, object valueIfKeyAbsent)

The keyName parameter

The returnDefault parameter

The valueIfKeyAbsent parameter