Add/edit Key/Value setting to iOS AppConfig
Description
Section titled “Description”This function is used to add a new Key/Value setting to an existing iOS AppConfig payload in the specified Device Application. If a setting with the specified key and type already exists, its value will be overwritten with the new value instead of creating a new setting. The key and type aren’t case-sensitive when the function looks for an existing setting.
The Device Application must already contain an iOS AppConfig payload with a configuration.
Syntax
Section titled “Syntax”Public Function AddKeyValueToAppConfigIOS(DeviceApplicationId As Integer, Key As String, Value As String, KeyValueType As String, changelogComment As String) As BooleanParameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
| DeviceApplicationId | Integer | The Id of the Device Application. Get it with Get Device Applications. |
| Key | String | The key of the setting. |
| Value | String | The value of the setting. For the type DateTime, use the format dd-MM-yyyy HH:mm:ss, for example 14-09-2017 12:30:00. |
| KeyValueType | String | The type of the setting: String, Boolean, Int, Float or DateTime. The value is case-sensitive. |
| changelogComment | String | A comment that is added to the changelog entry of the Device Application. |
Return value
Section titled “Return value”Returns a boolean value. True if succeeded, false if not. The function returns false if:
- No Device Application with the specified Id is found.
- The Device Application has no iOS AppConfig payload, or the payload has no configuration.
- The KeyValueType isn’t valid.
Example
Section titled “Example”Set oCMS = CreateObject("CapaInstaller.SDK")Wscript.echo oCMS.SetInstanceManagementPoint("2")
Dim iDeviceApplicationId : iDeviceApplicationId = 153Dim sKey : sKey = "AllowSync"Dim sValue : sValue = "True"Dim sKeyValueType : sKeyValueType = "Boolean"Dim sChangelogComment : sChangelogComment = "Added setting AllowSync with sdk"Wscript.echo "Added iOS Setting AllowSync: " & oCMS.AddKeyValueToAppConfigIOS(iDeviceApplicationId, sKey, sValue, sKeyValueType, sChangelogComment)
sKey = "UserEmail"sValue = ""sKeyValueType = "String"sChangelogComment = "Added setting UserEmail with sdk"Wscript.echo "Added iOS Setting UserEmail: " & oCMS.AddKeyValueToAppConfigIOS(iDeviceApplicationId, sKey, sValue, sKeyValueType, sChangelogComment)
sKey = "Port"sValue = "80"sKeyValueType = "Int"sChangelogComment = "Added setting Port with sdk"Wscript.echo "Added iOS Setting Port: " & oCMS.AddKeyValueToAppConfigIOS(iDeviceApplicationId, sKey, sValue, sKeyValueType, sChangelogComment)
sKey = "UserEmailDownloadSize"sValue = "2147483647899"sKeyValueType = "Float"sChangelogComment = "Added setting UserEmailDownloadSize with sdk"Wscript.echo "Added iOS Setting UserEmailDownloadSize: " & oCMS.AddKeyValueToAppConfigIOS(iDeviceApplicationId, sKey, sValue, sKeyValueType, sChangelogComment)
sKey = "LicenseDate"sValue = "14-09-2017 12:30:00"sKeyValueType = "DateTime"sChangelogComment = "Added setting LicenseDate with sdk"Wscript.echo "Added iOS Setting LicenseDate: " & oCMS.AddKeyValueToAppConfigIOS(iDeviceApplicationId, sKey, sValue, sKeyValueType, sChangelogComment)