SDK for integrating with an Optable Data Connectivity Node (DCN) from an iOS application.
The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift compiler.
Once you have your Swift package set up, you can add this SDK as a dependency. Add it to the dependencies value of your Package.swift or the Package list in Xcode.
dependencies: [
.package(url: "https://github.com/Optable/optable-ios-sdk", .branch("master"))
]CocoaPods is a dependency manager for Cocoa projects. For usage and installation instructions, visit their website.
To integrate this SDK into your Xcode project using CocoaPods, specify it in your Podfile:
pod 'OptableSDK'Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.
To integrate this SDK into your Xcode project using Carthage, specify it in your Cartfile:
github "Optable/optable-ios-sdk"
Simplest usage example:
// Configure
let config = OptableConfig(tenant: "dcn.customer.com", originSlug: "my-app")
let optableSDK = OptableSDK(config: config) // can instantiate multiple instances
// Use
let ids: [OptableIdentifier] = [
.emailAddress("test@test.test"),
.phoneNumber("+1234567890")
]
try await optableSDK.identify(ids)For more detailed usage guide, see our:
The Swift and Objective-C demo applications show a working example of identify , targeting, profile and witness APIs, as well as an integration with the Google Ad Manager 360 ad server, enabling the targeting of ads served by GAM360 to audiences activated in the Optable DCN.
By default, the demo applications will connect to the Optable demo DCN.
The demo apps depend on the GAM Mobile Ads SDK for iOS and load ads from a GAM360 account operated by Optable.
Build
Cocoapods is required to build the demo-ios-swift and demo-ios-objc applications. After cloning the repo, simply cd into either of the two demo app directories and run:
cd demo-ios-swift
# Install dependencies
pod installThen open the generated demo-ios-swift.xcworkspace or demo-ios-objc.xcworkspace in Xcode, and build and run from there.