Skip to main content

Installation — iOS SDK

The OpenCDP iOS SDK is available via Swift Package Manager or CocoaPods.

Prerequisites​

  • iOS 13.0+
  • Xcode 14+
  • Swift 5.9+

Step 1 — Add the dependency​

In Xcode: File → Add Packages →

https://github.com/code-matic/opencdp-ios-sdk.git

Select version 1.0.2 or later.

CocoaPods​

pod 'OpenCDP', '~> 1.0.2'

Then:

pod install

Open the .xcworkspace file.

Step 2 — Initialize​

import OpenCDP

@main
struct MyApp: App {
init() {
let config = OpenCDPConfig(
cdpApiKey: "YOUR_CDP_API_KEY",
debug: true
)
OpenCDP.shared.initialize(config: config)
}

var body: some Scene {
WindowGroup { ContentView() }
}
}

Verify it worked​

Build succeeds. With debug: true, Xcode console shows OpenCDP init logs on launch.

Next steps​