Appearance
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:
Open your Xcode project
Add Package Dependency
- In Xcode, go to
File→Add Package Dependencies... - Or right-click on your project in the navigator and select
Add Package Dependencies...
- In Xcode, go to
Enter Repository URL
- Paste the GitHub repository URL:
https://github.com/RingierAdvertising/tagmanager-sdk-ios - Click
Add Package
- Paste the GitHub repository URL:
Select Version
- Choose the version rule (we recommend "Up to Next Major Version")
- Select the latest version
- Click
Add Package
Add to Target
- Select your app target
- Click
Add Package
Integration
Import the SDK
Add the import statement to your Swift files:
swift
import RingierAdSDKInitialize 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:
- Build your project (
Cmd + B) - Check for compilation errors
- Run a simple SDK method to ensure it's working:
swift
// Should return the SDK version
print("\(RingierAd.version)")
