Skip to main content

Prerequisites

Swift Package Manager

Option 1: Package.swift

Add the following to your Package.swift file:

Option 2: Xcode

  1. File → Add Package Dependencies
  2. Enter the repository URL: https://github.com/dynamic-labs/sdk-swift.git
  3. Select version 0.0.4 or from: 0.0.4
  4. Add to your target

Setup in App

1. Configure Environment Variables

Add the following environment variables to your app scheme:
  1. In Xcode, go to Product → Scheme → Edit Scheme
  2. Select “Run” from the left sidebar
  3. Go to the “Arguments” tab
  4. Under “Environment Variables”, add:
Use the environment ID from your Dynamic dashboard (see Prerequisites above).

2. Initialize the SDK

Import and configure the SDK in your Swift files: