Skip to content

Installation Guide

This guide will walk you through the process of installing and integrating our iOS SDK into your Xcode project.

Prerequisites

  • Xcode 16.0 or later
  • iOS 13.0 or later
  • Swift 5.10 or later

Installation

Swift Package Manager

Swift Package Manager is the recommended and only supported way to integrate our SDK into your project.

Steps:

  1. Open your Xcode project

  2. Add Package Dependency

    • In Xcode, go to FileAdd Package Dependencies...
    • Or right-click on your project in the navigator and select Add Package Dependencies...
  3. Enter Repository URL

    • Paste the GitHub repository URL: https://github.com/RingierAdvertising/tagmanager-sdk-ios
    • Click Add Package
  4. Select Version

    • Choose the version rule (we recommend "Up to Next Major Version")
    • Select the latest version
    • Click Add Package
  5. Add to Target

    • Select your app target
    • Click Add Package

Integration

Import the SDK

Add the import statement to your Swift files:

swift
import RingierAdSDK

Initialize the SDK

Add the following code to your AppDelegate.swift or SceneDelegate.swift:

swift
import UIKit
import RingierAdSDK

@main
class AppDelegate: UIResponder, UIApplicationDelegate {
    
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        // Initialize the SDK
        let url: URL = URL(string: "https://cdn.ringier-advertising.ch/..../ios.json")!
        let settings = RingierAdSDKSettings(configURL: url, logLevel: .verbose, debug: false)
        RingierAd.start(settings: settings)
        return true
    }
}

Verification

To verify the installation was successful:

  1. Build your project (Cmd + B)
  2. Check for compilation errors
  3. Run a simple SDK method to ensure it's working:
swift
// Should return the SDK version
print("\(RingierAd.version)")