Skip to content

Objective-C Setup Guide

Objective-C apps (or mixed Swift/ObjC projects) can use the TelemetryDeck Swift SDK through Objective-C interop.

Installing the package

  1. Open Xcode and navigate to your project
  2. Select FileAdd Package Dependencies...
  3. Paste https://github.com/TelemetryDeck/SwiftSDK into the search field
  4. Select the SwiftSDK package
  5. Set the Dependency Rule to Up to Next Major Version
  6. Click Add Package

Linking the package

In the Choose Package Products for SwiftSDK screen, select the TelemetryDeck library and click Add Package.

Multiple targets

If Xcode doesn't prompt you, add it manually: select your target → Build PhasesLink Binary With Libraries+ → select TelemetryDeck.

Initializing TelemetryDeck

Add initialization to your App Delegate's application:didFinishLaunchingWithOptions::

@import TelemetryDeck;

- (BOOL)application:(UIApplication *)application
    didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

    [TelemetryDeck initializeWithAppID:@"YOUR-APP-ID"
                             namespace:@"YOUR-NAMESPACE"];

    return YES;
}

You need your app's unique identifier and namespace

Both values are available in the TelemetryDeck Dashboard under your app's settings.

Verify your setup

Run your app. The SDK automatically sends a TelemetryDeck.Session.started event on launch.

Test signals

Events from DEBUG builds are tagged as test signals. Enable Test Mode in the TelemetryDeck Dashboard to see them.

Open the Dashboard → "Explore > Recent Signals" with Test Mode enabled.


Sending custom events

[TelemetryDeck event:@"pizzaModeActivated"];

With parameters:

[TelemetryDeck event:@"pizzaModeActivated"
           parameters:@{@"cheeseMode": @"extraCheesy"}];

App Store requirements

See our Apple App Privacy guide and Privacy FAQ.

What's next