The Application Real-Time Monitoring Service (ARMS) Real User Monitoring SDK for iOS provides static methods to configure data collection, user tracking, and custom telemetry. This reference covers common SDK configurations, their parameters, constraints, and error behavior.
Quick reference
| Goal | Method |
|---|---|
| Set the data endpoint | setEndpoint |
| Set the workspace | setWorkspace |
| Initialize the SDK | start |
| Override the device ID | setDeviceID |
| Override the app version | setAppVersion |
| Tag a distribution channel | setChannelID |
| Specify the environment | setEnvironment |
| Associate data with a user | setUserName |
| Attach user metadata | setUserExtraInfo |
| Add global properties | setExtraInfo / addExtraInfo |
| Report a custom exception | setCustomException |
| Report a custom event | setCustomEvent |
| Report a custom log | setCustomLog |
Initialization
Configure the endpoint and workspace before you call start. The following example shows the required calling sequence:
// Step 1: Configure the endpoint (required, must precede start)
setEndpoint("<your-endpoint>")
// Step 2: Configure the workspace (required, must precede start)
setWorkspace("<your-workspace>")
// Step 3 (optional): Set environment, device ID, app version, or channel ID
setEnvironment(.PROD)
setDeviceID("<custom-device-id>")
setAppVersion("1.2.0")
setChannelID("app-store")
// Step 4: Initialize the SDK
start("<your-service-id>")Replace the placeholders with your actual values:
| Placeholder | Description |
|---|---|
<your-endpoint> | Endpoint address from the ARMS console |
<your-workspace> | Workspace identifier from the ARMS console |
<your-service-id> | Unique app ID generated on the Real User Monitoring platform |
Set the endpoint
Associate the SDK with a data endpoint. Call this method before start.
@objc
public static func setEndpoint(_ endpoint: String)| Parameter | Description | Constraints | On failure |
|---|---|---|---|
endpoint | Endpoint address | String length must be greater than 0 and less than 2,083. | The call fails and the SDK stops. |
Set the workspace
Associate the SDK with a workspace. Call this method before start.
@objc
public static func setWorkspace(_ workspace: String)| Parameter | Description | Constraints | On failure |
|---|---|---|---|
workspace | Workspace address | String length must be greater than 0 and less than 2,083. | The call fails and the SDK stops. |
Initialize the SDK
Start the SDK after you configure the endpoint and workspace.
@objc(start:)
public static func start(_ serviceId: String)| Parameter | Description | Constraints | On failure |
|---|---|---|---|
serviceId | Unique app ID generated on the Real User Monitoring platform | Non-empty string. | The call fails and the SDK stops. |
Set a custom device ID
Override the default device ID. After you set this value, the SDK reports it instead of the auto-generated ID.
@objc
public static func setDeviceID(_ deviceID: String)| Parameter | Description | Constraints | On failure |
|---|---|---|---|
deviceID | Custom device ID | 1--255 characters. Allowed characters: letters, digits, colons (:), spaces, underscores (_), hyphens (-), periods (.), and at signs (@). | The call fails. The setting is not applied. |
Set a custom app version
Report a custom app version instead of the version that the SDK detects automatically.
@objc
public static func setAppVersion(_ appVersion: String)| Parameter | Description | Constraints | On failure |
|---|---|---|---|
appVersion | Custom app version string | 1--63 characters. | The call fails. The setting is not applied. |
Set the channel ID
Tag the distribution channel for the app, such as app-store or an enterprise distribution identifier.
@objc
public static func setChannelID(_ channelID: String)| Parameter | Description | Constraints | On failure |
|---|---|---|---|
channelID | Distribution channel identifier | 1--255 characters. | The call fails. The setting is not applied. |
Set the environment
Specify the runtime environment. Call this method after setConfigAddress and before start.
@objc
public static func setEnvironment(_ env: Env)| Parameter | Description | Constraints | On failure |
|---|---|---|---|
env | Runtime environment | One of the Env enum values listed below. | The call fails. The setting is not applied. |
Env values
| Value | Description |
|---|---|
LOCAL | Local environment |
Daily | Daily build environment |
PRE | Pre-release environment |
GRAY | Grayscale environment |
PROD | Production environment (default) |
None | No environment specified |
User and global properties
Set the username
Associate monitoring data with a user identity for per-user filtering and analysis.
@objc
public static func setUserName(_ userID: String)| Parameter | Description | Constraints | On failure |
|---|---|---|---|
userID | Username identity | Can be null or empty. Maximum 256 characters. Allowed characters: digits, letters, colons (:), spaces, forward slashes (/), underscores (_), hyphens (-), periods (.), and at signs (@). | The call fails. The setting is not applied. |
Set user metadata
Attach key-value metadata to the current user. This data accompanies the username in analytics.
@objc(setUserExtraInfo:)
public static func setUserExtraInfo(_ extraInfo: [String: AnyObject])| Parameter | Description | Constraints | On failure |
|---|---|---|---|
extraInfo | User metadata as key-value pairs | Can be null or empty. The serialized JSON string must not exceed 7,000 characters. | The call fails. The setting is not applied. |
Set global properties
Attach custom properties to all subsequent data that the SDK reports. Use these properties to segment analytics by business dimensions such as region, experiment group, or feature flag.
The SDK provides two methods:
// Replace all global properties
@objc(setExtraInfo:)
public static func setExtraInfo(_ extraInfo: [String: AnyObject])
// Append to existing global properties
@objc(addExtraInfo:)
public static func addExtraInfo(_ extraInfo: [String: AnyObject])| Parameter | Description | Constraints | On failure |
|---|---|---|---|
extraInfo | Custom properties as key-value pairs | Can be null or empty. The serialized JSON string must not exceed 7,000 characters. | The call fails. The setting is not applied. |
setExtraInfo clears all previously set properties. To append new properties without removing existing ones, use addExtraInfo.
Custom telemetry
Report a custom exception
Report an application exception with its type, cause, and stack trace.
@objc(setCustomException:causeBy:errorDump:)
public static func setCustomException(_ exceptionType: String, _ causeBy: String, _ errorDump: String)| Parameter | Required | Description | Constraints | On failure |
|---|---|---|---|---|
exceptionType | Yes | Exception type identifier | 1--256 characters. | The call fails. The setting is not applied. |
causeBy | No | Cause of the exception | Can be null or empty. Maximum 512 characters; truncated if exceeded. | N/A |
errorDump | No | Stack trace or error details | Can be null or empty. Maximum 10,000 characters; truncated if exceeded. | N/A |
Report a custom event
Report a custom event with optional grouping, snapshots, numeric values, and metadata. The SDK provides multiple overloads that share the same base parameters. Choose the overload that matches the data you need to attach.
Full method signature (all optional parameters included):
@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
)Parameters
| Parameter | Required | Description | Constraints | On failure |
|---|---|---|---|---|
name | Yes | Event name | 1--256 characters. | The call fails. The setting is not applied. |
group | No | Event group for categorization | Can be nil or empty. Maximum 256 characters; truncated if exceeded. | N/A |
snapshots | No | Event snapshot data | Can be nil or empty. Maximum 7,000 characters; truncated if exceeded. | N/A |
value | No | Numeric event value | Double. Defaults to 0. | N/A |
info | No | Additional key-value metadata | Can be null or empty. The serialized JSON must not exceed 7,000 characters. | N/A |
Available overloads
Pass only the parameters you need:
// Event name only
@objc(setCustomEvent:)
setCustomEvent(_ name: String)
// With group
@objc(setCustomEvent:group:)
setCustomEvent(_ name: String, group: String?)
// With group and snapshots
@objc(setCustomEvent:group:snapshots:)
setCustomEvent(_ name: String, group: String?, snapshots: String?)
// With group and numeric value
@objc(setCustomEvent:group:value:)
setCustomEvent(_ name: String, group: String?, value: Double)
// With group and metadata
@objc(setCustomEvent:group:info:)
setCustomEvent(_ name: String, group: String?, info: [String: String]?)
// With group, snapshots, and numeric value
@objc(setCustomEvent:group:snapshots:value:)
setCustomEvent(_ name: String, group: String?, snapshots: String?, value: Double)
// With group, snapshots, and metadata
@objc(setCustomEvent:group:snapshots:info:)
setCustomEvent(_ name: String, group: String?, snapshots: String?, info: [String: String]?)
// With group, numeric value, and metadata
@objc(setCustomEvent:group:value:info:)
setCustomEvent(_ name: String, group: String?, value: Double, info: [String: String]?)
// All parameters
@objc(setCustomEvent:group:snapshots:value:info:)
setCustomEvent(_ name: String, group: String?, snapshots: String?, value: Double, info: [String: String]?)Example: report a purchase event with a value and metadata
setCustomEvent(
"purchase_completed",
group: "checkout",
value: 99.99,
info: ["currency": "USD", "item_count": "3"]
)Report a custom log
Report a custom log entry with optional name, snapshot, level, and metadata. Like custom events, the SDK provides multiple overloads.
Full method signature (all optional parameters included):
@objc(setCustomLog:name:snapshots:level:info:)
public static func setCustomLog(
_ logInfo: String,
name: String? = nil,
snapshots: String? = "",
level: String? = "INFO",
info: [String: String]? = nil
)Parameters
| Parameter | Required | Description | Constraints | On failure |
|---|---|---|---|---|
logInfo | Yes | Log message content | 1--10,000 characters; truncated if exceeded. | The call fails. The setting is not applied. |
name | No | Log name for categorization | 1--256 characters. | N/A |
snapshots | No | Log snapshot data | Can be null or empty. Maximum 7,000 characters; truncated if exceeded. | N/A |
level | No | Log severity level | 1--256 characters. Defaults to INFO. | N/A |
info | No | Additional key-value metadata | Can be null or empty. The serialized JSON length counts toward the total logInfo size limit. | N/A |
Available overloads
// Log message only
@objc(setCustomLog:)
setCustomLog(_ logInfo: String)
// With name
@objc(setCustomLog:name:)
setCustomLog(_ logInfo: String, name: String?)
// With name and snapshots
@objc(setCustomLog:name:snapshots:)
setCustomLog(_ logInfo: String, name: String?, snapshots: String?)
// All parameters
@objc(setCustomLog:name:snapshots:level:info:)
setCustomLog(_ logInfo: String, name: String?, snapshots: String?, level: String?, info: [String: String]?)Example: report a warning-level log with metadata
setCustomLog(
"Payment gateway timeout after 30s",
name: "payment_error",
level: "WARNING",
info: ["gateway": "stripe", "retry_count": "2"]
)