Objective-C SDK
This repository houses the Optimizely Mobile and OTT experimentation SDKs.
Getting Started
Using the SDK
See the Mobile developer documentation or OTT developer documentation to learn how to set up an Optimizely X project and start using the SDK.
Requirements
Installing the SDK
Please note below that <platform> is used to represent the platform on which you are building your app. Currently, we support iOS
and tvOS
platforms.
Cocoapod
-
Add the following line to the Podfile:
pod 'OptimizelySDK<platform>'
-
Run the following command:
pod install
Further installation instructions for Cocoapods: https://guides.cocoapods.org/using/getting-started.html
Carthage
- Add the following lines to the Cartfile:
github "optimizely/objective-c-sdk" github "jsonmodel/jsonmodel" github "ccgus/fmdb"
-
Run the following command:
carthage update
-
Link the frameworks to your project. Go to your project target's Link Binary With Libraries and drag over the following from the Carthage/Build/<platform> folder:
FMDB.framework JSONModel.framework OptimizelySDKCore.framework OptimizelySDKDatafileManager.framework OptimizelySDKEventDispatcher.framework OptimizelySDKShared.framework OptimizelySDKUserProfile.framework< OptimizelySDK<platform>.framework
-
To ensure that proper bitcode-related files and dSYMs are copied when archiving your app, you will need to install a Carthage build script:
- Add a new Run Script phase in your target's Build Phase.
- In the script area include:
/usr/local/bin/carthage copy-frameworks
- Add the frameworks to the Input Files list:
$(SRCROOT)/Carthage/Build/<platform>/FMDB.framework
$(SRCROOT)/Carthage/Build/<platform>/JSONModel.framework
$(SRCROOT)/Carthage/Build/<platform>/OptimizelySDKCore.framework
$(SRCROOT)/Carthage/Build/<platform>/OptimizelySDKDatafileManager.framework
$(SRCROOT)/Carthage/Build/<platform>/OptimizelySDKEventDispatcher.framework
$(SRCROOT)/Carthage/Build/<platform>/OptimizelySDKShared.framework
$(SRCROOT)/Carthage/Build/<platform>/OptimizelySDKUserProfile.framework
$(SRCROOT)/Carthage/Build/<platform>/OptimizelySDK<platform>.framework
- Add a new Run Script phase in your target's Build Phase.
Futher installation instructions for Carthage: https://github.com/Carthage/Carthage
Clone Source
Clone repo and manually add source to project to build.
Contributing
Please see CONTRIBUTING.