Page tree
Skip to end of metadata
Go to start of metadata

Description

This function is used to add a new Key/Value setting to an existing AppConfig payload in the specified profile. 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.

Syntax

Public Function AddKeyValueToAppConfigIOS(DeviceApplicationId As Integer, Key As String, Value As String, KeyValueType As String, changelogComment As String) As Boolean

Parameters


DeviceApplicationID (Integer)

The id of the Device Application you wish to edit.

(Use Get Device Applications to get more information on existing Device Applications)

Key (String)

The Key of the new setting

Value (String)

The Value of the new setting


KeyValueType (String)

The type of the new setting. Valid types are: String, Boolean, Int, Float, DateTime. (DateTime format: dd-MM-yyyy HH:mm:ss)

ChangelogComment  (String)

Comment you wish to be added to the changelog on the Device Application



Return value

Returns a boolean value. True if succeeded, false if not.

Example

VBScript
Set oCMS = CreateObject("CapaInstaller.SDK") 
Wscript.echo oCMS.SetDefaultManagementPoint("2") 

Dim iProfileId              : iProfileId = 153
Dim 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(iProfileId, sKey, sValue, sKeyValueType, sChangelogComment)

sKey = "UserEmail"
sValue = ""
sKeyValueType = "String"
sChangelogComment = "Added setting UserEmail with sdk"
Wscript.echo "Added iOS Setting UserEmail: " & oCMS.AddKeyValueToAppConfigIOS(iProfileId, sKey, sValue, sKeyValueType, sChangelogComment)

sKey = "Port"
sValue = "80"
sKeyValueType = "Int"
sChangelogComment = "Added setting Port with sdk"
Wscript.echo "Added iOS Setting Port: " & oCMS.AddKeyValueToAppConfigIOS(iProfileId, sKey, sValue, sKeyValueType, sChangelogComment)

sKey = "UserEmailDownloadSize"
sValue = "2147483647899"
sKeyValueType = "Float"
sChangelogComment = "Added setting UserEmailDownloadSize with sdk"
Wscript.echo "Added iOS Setting UserEmailDownloadSize: " & oCMS.AddKeyValueToAppConfigIOS(iProfileId, 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(iProfileId, sKey, sValue, sKeyValueType, sChangelogComment)
  • No labels