RUM Mobile SDK - iOS

Prev Next

Catchpoint's RUM Mobile SDK enables you to send performance metrics to Catchpoint from your mobile applications. This article explains how to configure an iOS application to send data to Catchpoint via the RUM Mobile SDK.

Demo App

To try out Mobile RUM before deploying it on your application, we've included a demo app. To run the app, install Xcode, open the demo app package, and provide your app token (found in the RUM app in the portal UI).

RUM Mobile SDK - iOS Installation

Step 1: Extract the Zip Files

Note

The RUM Mobile SDK would typically be distributed through a centralized iOS SDK distribution, but due to our dependency on the opentelemetry-swift OkHttp instrumentation, we have forked opentelemetry-swift library and customized it to create our SDK. Therefore, extensive discussions would be required to get approval to upload the SDK. Until the catchpoint-ios-sdk and opentelemetry-swift SDK are uploaded to a central distribution, we will provide local versions of these libraries.

Download and extract this zip file for Swift versions 6.2.3 and up:

packages.6.2.3.zip
Download and extract this zip file for older Swift versions:

packages.zip

  • packages.zip contains the xcframeworks CatchpointApi.xcframework, CatchpointIOSSdk.xcframework, CatchpointIOSSdkCore.xcframework, OpenTelemetryApi.xcframework and OpenTelemetrySdk.xcframework.

packages.png

Step 2: Add Dependencies

  • Navigate to the project and open the general settings.
  • Go to Frameworks, Libraries, and Embedded Contents

ios-sdk-install-2.png

  • Click on + Add Items button
  • In the pop up window click on dropdown Add Others and then click Add Files

ios-sdk-install-3.png

  • Navigate to the folder where you have extracted packages.zip file

ios-sdk-install-4.png

  • Select CatchpointApi.xcframework and click Open
  • Repeat the same process for OpenTelemetryApi.xcframework and OpenTelemetrySdk.xcframework
  • Once all the packages are added you will see them in the Frameworks folder as in the image below

ios-sdk-install-5.png

Step 3: Initialize Catchpoint SDK

Go to your app entry file and import the CatchpointApi as in code snippet below

import CatchpointApi

Set App Token

then initialize the CatchpointSdk as in the code snippet below

    
 let config = CatchpointSdkConfiguration.builder()
            .setAppToken("<your-app-token-goes-here>")
            .build()
 
 CatchpointSdk.start(config: config)

Set Custom Collector

 let defaultSpanProcessor = BatchSpanProcessor(
            spanExporter: OtlpHttpTraceExporter(
                endpoint: URL(string: _tracesIngestUrl)!,
                envVarHeaders: [
                    ("Authorization", "<your-auth-token-goes-here>")
                ]
            )
        )

 let config = CatchpointSdkConfiguration.builder()
            .setSpanProcessor(defaultSpanProcessor)
            .build()
 
 CatchpointSdk.start(config: config)