Application Real-Time Monitoring Service (ARMS) Real User Monitoring (RUM) provides various software development kit (SDK) configuration items. You can set these parameters to meet your requirements. This topic describes the common SDK configurations for iOS applications.
Startup configuration
Set the Endpoint address
Each application must be associated with an Endpoint address. You must call this interface before you call the start: method.
@objc
public static func setEndpoint(_ endpoint: String)Parameter | Description | Limit | Failure result |
endpoint | The Endpoint address. | The string must be greater than 0 and less than 2,083 characters in length. | The call fails and the SDK stops. |
Set the Workspace address
Each application must be associated with a Workspace. You must call this interface before you call the start: method.
@objc
public static func setWorkspace(_ workspace: String)Parameter | Description | Limit | Failure result |
workspace | The Workspace address. | The string must be greater than 0 and less than 2,083 characters in length. | The call fails and the SDK stops. |
Startup interface
Call the start: method to initialize the SDK.
@objc(start:)
public static func start(_ serviceId: String)Parameter | Description | Limit | Failure result |
serviceId | ServiceId | The unique ID of the application that is generated on the RUM platform. | The call fails and the SDK stops. |
Set a custom device ID
You can use this method to set a custom device ID. After a custom ID is set, the SDK uses it instead of the default device ID.
@objc
public static func setDeviceID(_ deviceID: String)Parameter | Description | Limit | Failure result |
deviceID | The custom device ID. | The string must be greater than 0 and less than 256 characters in length. It must not contain special characters. Only letters, digits, colons (:), spaces, underscores (_), hyphens (-), periods (.), and at signs (@) are supported. | The call fails and the settings for this call are invalid. |
Set a custom app version number
You can use this method to set a custom app version number. The SDK then reports this version number instead of the default one.
@objc
public static func setAppVersion(_ appVersion: String)Parameter | Description | Limit | Failure result |
appVersion | The custom app version number. | The string must be greater than 0 and less than 64 characters in length. | The call fails and the settings for this call are invalid. |
Set a user channel ID
You can use this method to differentiate the release channels of the application.
@objc
public static func setChannelID(_ channelID: String)Parameter | Description | Limit | Failure result |
channelID | The custom channel ID. | The string must be greater than 0 and less than 256 characters in length. | The call fails and the settings for this call are invalid. |
Set the application environment
You can use this method to differentiate and specify the application environment, such as LOCAL, DAILY, or PROD.
@objc
public static func setEnvironment(_ env: Env)Parameter | Description | Limit | Failure result |
env | Enumerated value of the application environment. This must be called after the | Enumeration values for Env:
| The call fails and the settings for this call are invalid. |
Custom information
Set a custom username
The SDK lets you set user-related information. This helps you analyze data in scenarios that are associated with specific users.
@objc
public static func setUserName(_ userID: String)Parameter | Description | Limit | Failure result |
userID | The username identity. | The string can be null or empty. The string must be 256 characters or less in length. It must not contain special characters. Only digits, letters, colons (:), spaces, forward slashes (/), underscores (_), hyphens (-), periods (.), and at signs (@) are allowed. | The call fails and the settings for this call are invalid. |
Set custom user extension information
The SDK lets you set custom user extension information. This helps you analyze data in scenarios that are associated with specific users.
@objc(setUserExtraInfo:)
public static func setUserExtraInfo(_ extraInfo: [String: AnyObject])Parameter | Description | Parameter Limits | Failure result |
extraInfo | The user extension information. | The Map can be null or empty. The API call fails if the converted JSON string exceeds 7000 characters. | The call fails and the settings for this call are invalid. |
Set custom global properties
After you set custom global properties, all new data automatically includes these properties. This is useful for analysis that involves business properties.
@objc(setExtraInfo:)
public static func setExtraInfo(_ extraInfo: [String: AnyObject])
@objc(addExtraInfo:)
public static func addExtraInfo(_ extraInfo: [String: AnyObject])Parameter | Description | Limit | Failure result |
extraInfo | The property information. | The map can be null or empty. After conversion to a JSON string, the length must be 7,000 characters or less. Otherwise, the call fails. | The call fails and the settings for this call are invalid. |
Calling the setExtraInfo method clears previously set properties. To append new properties, use the addExtraInfo method.
Custom Exception
You can call the custom exception interface and pass the required parameters to collect custom exception data.
@objc(setCustomException:causeBy:errorDump:)
public static func setCustomException(_ exceptionType: String, _ causeBy: String, _ errorDump: String)Parameter | Description | Limit | Failure result |
exceptionType | Exception type (Required) | The string must be greater than 0 and no more than 256 characters in length. | The call fails and the settings for this call are invalid. |
causeBy | Exception cause | The string can be null or empty. The string must be 512 characters or less. Longer strings are truncated. | Not applicable. |
errorDump | Exception information | The string can be null or empty. The string must be 10,000 characters or less. Longer strings are truncated. | Not applicable. |
Custom events
The SDK supports reporting custom events. You can call the corresponding interfaces and pass the required parameters to collect custom event data.
@objc(setCustomEvent:)
public static func setCustomEvent(_ name: String)Parameter | Description | Limit | Failure result |
name | Event name (Required) | The string must be greater than 0 and no more than 256 characters in length. | The call fails and the settings for this call are invalid. |
@objc(setCustomEvent:group:)
public static func setCustomEvent(_ name: String, group: String? = nil)Parameter | Description | Limit | Failure result |
name | Event name (Required) | The string must be greater than 0 and no more than 256 characters in length. | The call fails and the settings for this call are invalid. |
group | Event group | The string can be The string must be 256 characters or less. Longer strings are truncated. | Not applicable. |
@objc(setCustomEvent:group:snapshots:)
public static func setCustomEvent(_ name: String, group: String? = nil, snapshots: String? = nil)Parameter | Description | Limit | Failure result |
name | Event name (Required) | The string must be greater than 0 and no more than 256 characters in length. | The call fails and the settings for this call are invalid. |
group | Event group | The string can be The string must be 256 characters or less. Longer strings are truncated. | Not applicable. |
snapshots | Event snapshot | The string can be The string must be 7,000 characters or less. Longer strings are truncated. | Not applicable. |
@objc(setCustomEvent:group:value:)
public static func setCustomEvent(_ name: String, group: String? = nil, value: Double = 0)Parameter | Description | Limit | Failure result |
name | Event name (Required) | The string must be greater than 0 and no more than 256 characters in length. | The call fails and the settings for this call are invalid. |
group | Event group | The string can be The string must be 256 characters or less. Longer strings are truncated. | Not applicable. |
value | Event value | double type | Not applicable. |
@objc(setCustomEvent:group:info:)
public static func setCustomEvent(_ name: String, group: String? = nil, info: [String: String]? = nil)Parameter | Description | Limit | Failure result |
name | Event name (Required) | The string must be greater than 0 and no more than 256 characters in length. | The call fails and the settings for this call are invalid. |
group | Event group | The string can be The string must be 256 characters or less. Longer strings are truncated. | Not applicable. |
info | Additional event information | The map can be null or empty. After conversion to a JSON string, the length must be 7,000 characters or less. Otherwise, the call fails. | Not applicable |
@objc(setCustomEvent:group:snapshots:value:)
public static func setCustomEvent(_ name: String, group: String? = nil, snapshots: String? = nil, value: Double = 0) Parameter | Description | Limit | Failure result |
name | Event name (Required) | The string must be greater than 0 and no more than 256 characters in length. | The call fails and the settings for this call are invalid. |
group | Event group | The string can be The string must be 256 characters or less. Longer strings are truncated. | Not applicable. |
snapshots | Event snapshot | The string can be The string must be 7,000 characters or less. Longer strings are truncated. | Not applicable. |
value | Event value | double type. | Not applicable. |
@objc(setCustomEvent:group:snapshots:info:)
public static func setCustomEvent(_ name: String, group: String? = nil, snapshots: String? = nil, info: [String: String]? = nil)Parameter | Description | Limit | Failure result |
name | Event name (Required) | The string must be greater than 0 and no more than 256 characters in length. | The call fails and the settings for this call are invalid. |
group | Event group | The string can be The string must be 256 characters or less. Longer strings are truncated. | Not applicable. |
snapshots | Event snapshot | The string can be The string must be 7,000 characters or less. Longer strings are truncated. | Not applicable. |
info | Additional event information | The map can be null or empty. After conversion to a JSON string, the length must be 7,000 characters or less. Otherwise, the call fails. | Not applicable |
@objc(setCustomEvent:group:value:info:)
public static func setCustomEvent(_ name: String, group: String? = nil, value: Double = 0, info: [String: String]? = nil) Parameter | Description | Limit | Failure result |
name | Event name (Required) | The string must be greater than 0 and no more than 256 characters in length. | The call fails and the settings for this call are invalid. |
group | Event group | The string can be The string must be 256 characters or less. Longer strings are truncated. | Not applicable. |
value | Event value | double type | Not applicable. |
info | Additional event information | The map can be null or empty. After conversion to a JSON string, the length must be 7,000 characters or less. Otherwise, the call fails. | Not applicable |
@objc(setCustomEvent:group:snapshots:value:info:)
public static func setCustomEvent(_ name: String, group: String? = nil, snapshots: String? = nil, value: Double = 0, info: [String: String]? = nil)Parameter | Description | Limit | Failure result |
name | Event name (Required) | The string must be greater than 0 and no more than 256 characters in length. | The call fails and the settings for this call are invalid. |
group | Event group | The string can be The string must be 256 characters or less. Longer strings are truncated. | Not applicable. |
snapshots | Event snapshot | The string can be The string must be 7,000 characters or less. Longer strings are truncated. | Not applicable. |
value | Event value | double type | Not applicable. |
info | Additional event information | The map can be null or empty. After conversion to a JSON string, the length must be 7,000 characters or less. Otherwise, the call fails. | Not applicable |
Custom logs
The SDK supports reporting custom log information. You can call the corresponding interfaces and pass the required parameters to collect custom log data.
@objc(setCustomLog:)
public static func setCustomLog(_ logInfo: String)Parameter | Description | Limit | Failure result |
logInfo | Log information (Required) | The string must be greater than 0 and no more than 10,000 characters in length. Longer strings are truncated. | The call fails and the settings for this call are invalid. |
@objc(setCustomLog:name:)
public static func setCustomLog(_ logInfo: String, name: String? = nil) Parameter | Description | Limit | Failure result |
logInfo | Log information (Required) | The string must be greater than 0 and no more than 10,000 characters in length. Longer strings are truncated. | The call fails and the settings for this call are invalid. |
name | Log name | The string must be greater than 0 and no more than 256 characters in length. | Not applicable. |
@objc(setCustomLog:name:snapshots:)
public static func setCustomLog(_ logInfo: String, name: String? = nil, snapshots: String? = "") Parameter | Description | Limit | Failure result |
logInfo | Log information (Required) | The string must be greater than 0 and no more than 10,000 characters in length. Longer strings are truncated. | The call fails and the settings for this call are invalid. |
name | Log name | The string must be greater than 0 and no more than 256 characters in length. | Not applicable. |
snapshots | Log snapshot | The string can be null or empty. The string must be 7,000 characters or less. Longer strings are truncated. | Not applicable. |
@objc(setCustomLog:name:snapshots:level:info:)
public static func setCustomLog(_ logInfo: String, name: String? = nil, snapshots: String? = "", level: String? = "INFO", info: [String: String]? = nil)Parameter | Description | Limit | Failure result |
logInfo | Log information (Required) | The string must be greater than 0 and no more than 10,000 characters in length. Longer strings are truncated. | The call fails and the settings for this call are invalid. |
name | Log name | The string must be greater than 0 and no more than 256 characters in length. | Not applicable. |
snapshots | Log snapshot | The string can be null or empty. The string must be 7,000 characters or less. Longer strings are truncated. | Not applicable. |
level | Log level | The string must be greater than 0 and no more than 256 characters in length. The default value is INFO. | Not applicable. |
info | Additional log information | The map can be null or empty. After JSON conversion, the length of the string contributes to the total size of logInfo. The API call fails if this size exceeds the specified limit. | Not applicable |