Optimizely X Objective-C SDK for iOS and tvOS
Switch branches/tags
v2.1.0 v2.0.2-beta4 v2.0.2-beta3 v2.0.2-beta2 v2.0.2-beta1 v2.0.1 v2.0.0 v1.5.2 userProfileService-1.5.2 userProfileService-1.5.1 userProfileService-1.5.0 userProfileService-1.5.0-RC userProfileService-1.4.0 userProfileService-1.3.0 userProfile-1.1.9 userProfile-1.1.8 userProfile-1.1.7 userProfile-1.1.6 userProfile-1.1.5 userProfile-1.1.3 userProfile-1.1.0 userProfile-1.0.1 userProfile-1.0.1-alpha1 userProfile-1.0.0 userProfile-0.5.0 userProfile-0.5.0-alpha1 userProfile-0.4.0-alpha3 userProfile-0.4.0-alpha2 userProfile-0.4.0-alpha1 userProfile-0.3.0 userProfile-0.3.0-alpha3 userProfile-0.3.0-alpha2 userProfile-0.3.0-alpha1 userProfile-0.2.1 userProfile-0.2.1-alpha4 userProfile-0.2.1-alpha3 userProfile-0.2.1-alpha2 userProfile-0.2.1-alpha1 tvOSUniversal-1.5.2 tvOSUniversal-1.5.1 tvOSUniversal-1.5.0 tvOSUniversal-1.5.0-RC tvOSUniversal-1.4.0 tvOSUniversal-1.3.0 tvOS-universal-1.1.7 tvOS-universal-1.1.6 tvOS-universal-1.1.5 tvOS-universal-1.1.1 tvOS-1.5.2 tvOS-1.5.1 tvOS-1.5.0 tvOS-1.5.0-RC tvOS-1.4.0 tvOS-1.3.0 tvOS-1.1.9 tvOS-1.1.8 tvOS-1.1.7 tvOS-1.1.6 tvOS-1.1.5 tvOS-1.1.3 tvOS-1.1.0 tvOS-1.0.1 tvOS-1.0.1-alpha1 tvOS-1.0.0 tvOS-0.5.0 tvOS-0.5.0-alpha1 tvOS-0.4.0-alpha3 tvOS-0.4.0-alpha2 tvOS-0.4.0-alpha1 tvOS-0.3.0 tvOS-0.3.0-alpha1 tvOS-0.2.1 tvOS-0.2.1-alpha4 tvOS-0.2.1-alpha3 tvOS-0.2.1-alpha2 tvOS-0.2.1-alpha1 tvOS-0.1.9 tvOS-0.1.8 tvOS-0.1.7 tvOS-0.1.6 tvOS-0.1.5 tvOS-0.1.4 tvOS-0.1.3 tvOS-0.1.2 tvOS-0.1.1 tvOS-0.1.0 shared-1.5.2 shared-1.5.1 shared-1.5.0 shared-1.5.0-RC shared-1.4.0 shared-1.3.0 shared-1.1.9 shared-1.1.8 shared-1.1.7 shared-1.1.6 shared-1.1.5 shared-1.1.3 shared-1.1.0 shared-1.0.1
Nothing to show
Clone or download
Permalink
Failed to load latest commit information.
OptimizelyDemoApp Add missing nullable and nonnull annotations. Only log attribute not … Sep 21, 2018
OptimizelySDK.xcworkspace Kroach/oasis 2442 xcode94 (#254) Jun 7, 2018
OptimizelySDKCore Fix an issue where importing an Objective-C type called Optional caus… Sep 25, 2018
OptimizelySDKDatafileManager Add missing nullable and nonnull annotations. Only log attribute not … Sep 21, 2018
OptimizelySDKEventDispatcher updates for release 2.1.0 (#292) Aug 3, 2018
OptimizelySDKShared Add missing nullable and nonnull annotations. Only log attribute not … Sep 21, 2018
OptimizelySDKTVOS updates for release 2.1.0 (#292) Aug 3, 2018
OptimizelySDKUniversal add EventTagUtil to universal project (#314) Sep 25, 2018
OptimizelySDKUserProfileService Add missing nullable and nonnull annotations. Only log attribute not … Sep 21, 2018
OptimizelySDKiOS updates for release 2.1.0 (#292) Aug 3, 2018
Pods Add missing nullable and nonnull annotations. Only log attribute not … Sep 21, 2018
Scripts Release 2.0.2-beta2 changes (#275) Jun 27, 2018
docs ReadMe file for generating API documentation (#260) Jul 6, 2018
.gitignore Add AppIcon's and LaunchImage's to Demo Apps (#147) Jun 29, 2017
.slather.yml coveralls code coverage (#221) Apr 5, 2018
.swift-version add .swift-version file for CocoaPods Jan 7, 2017
.travis.yml Add missing nullable and nonnull annotations. Only log attribute not … Sep 21, 2018
CHANGELOG.md Fix return types on CHANGELOG. (#291) Aug 2, 2018
CONTRIBUTING.md add style guide (#233) Apr 6, 2018
LICENSE Update LICENSE Oct 12, 2016
Makefile (¯·._.· Initial Commit ·._.·¯) Sep 28, 2016
OptimizelySDKCore.podspec updates for release 2.1.0 (#292) Aug 3, 2018
OptimizelySDKDatafileManager.podspec updates for release 2.1.0 (#292) Aug 3, 2018
OptimizelySDKEventDispatcher.podspec updates for release 2.1.0 (#292) Aug 3, 2018
OptimizelySDKShared.podspec updates for release 2.1.0 (#292) Aug 3, 2018
OptimizelySDKTVOS.podspec updates for release 2.1.0 (#292) Aug 3, 2018
OptimizelySDKUserProfileService.podspec fix mistake (#293) Aug 3, 2018
OptimizelySDKiOS.podspec updates for release 2.1.0 (#292) Aug 3, 2018
Podfile Updating libraries based on SourceClear recommendation (#304) Aug 31, 2018
Podfile.lock Updating libraries based on SourceClear recommendation (#304) Aug 31, 2018
README.md add credits for third party libraries (#299) Aug 24, 2018

README.md

Objective-C SDK

Build Status Apache 2.0 Carthage compatible Platforms Podspec Platforms Podspec

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

  • iOS 8.0+ / tvOS 9.0+

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

  1. Add the following lines to the Podfile:
    use_frameworks!
    pod 'OptimizelySDK<platform>', '2.1.0'
  1. Run the following command:
    pod install

Further installation instructions for Cocoapods: https://guides.cocoapods.org/using/getting-started.html

Carthage

  1. Add the following lines to the Cartfile:
    github "optimizely/objective-c-sdk" "v2.1.0"
  1. Run the following command:

    carthage update

  2. 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:

    OptimizelySDKCore.framework
    OptimizelySDKDatafileManager.framework
    OptimizelySDKEventDispatcher.framework
    OptimizelySDKShared.framework
    OptimizelySDKUserProfileService.framework
    OptimizelySDK<platform>.framework

  3. 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>/OptimizelySDKCore.framework
      $(SRCROOT)/Carthage/Build/<platform>/OptimizelySDKDatafileManager.framework
      $(SRCROOT)/Carthage/Build/<platform>/OptimizelySDKEventDispatcher.framework
      $(SRCROOT)/Carthage/Build/<platform>/OptimizelySDKShared.framework
      $(SRCROOT)/Carthage/Build/<platform>/OptimizelySDKUserProfileService.framework
      $(SRCROOT)/Carthage/Build/<platform>/OptimizelySDK<platform>.framework

Futher installation instructions for Carthage: https://github.com/Carthage/Carthage

Manual Installation

The universal framework can be used in an application without the need for a third-party dependency manager. The universal framework packages up all Optimizely X Mobile modules, which include:

OptimizelySDKCore
OptimizelySDKShared
OptimizelySDKDatafileManager
OptimizelySDKEventDispatcher
OptimizelySDKUserProfileService

The universal framework for iOS includes builds for the following architectures:

i386
x86_64
ARMv7
ARMv7s
ARM64

The universal framework for tvOS includes builds for the following architectures:

x86_64
ARM64

Bitcode is enabled for both the iOS and tvOS universal frameworks.

In order to install the universal framework, follow the steps below:

  1. Download the iOS or tvOS framework.

  2. Unzip the framework, then drag the framework to your project in Xcode; Xcode should prompt you to select a target. Go to Build Phases and make sure that the framework is under the Link Binary with Libraries section.

  3. Go to the General tab and add the framework to the Embedded Binaries section. If the Embedded Binaries section is not visible, add the framework in the Copy Files section (you can add this section in Build Settings).

  4. The Apple store will reject your app if you have the universal framework installed as it includes simulator binaries. Therefore, a script to strip the extra binaries needs to be run before you upload the app. To do this, go to Build Phases and add a Run Script section by clicking the + symbol. Copy and paste the following script (make sure you replace the FRAMEWORK_NAME with the proper framework name! ):

    FRAMEWORK="FRAMEWORK_NAME"
    FRAMEWORK_EXECUTABLE_PATH="${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/$FRAMEWORK.framework/$FRAMEWORK"
    EXTRACTED_ARCHS=()
    for ARCH in $ARCHS
    do
       lipo -extract "$ARCH" "$FRAMEWORK_EXECUTABLE_PATH" -o "$FRAMEWORK_EXECUTABLE_PATH-$ARCH"
       EXTRACTED_ARCHS+=("$FRAMEWORK_EXECUTABLE_PATH-$ARCH")
    done
    lipo -o "$FRAMEWORK_EXECUTABLE_PATH-merged" -create "${EXTRACTED_ARCHS[@]}"
    rm "${EXTRACTED_ARCHS[@]}"
    rm "$FRAMEWORK_EXECUTABLE_PATH"
    mv "$FRAMEWORK_EXECUTABLE_PATH-merged" "$FRAMEWORK_EXECUTABLE_PATH"
    

If you choose to build the universal framework yourself, you can do so by running the OptimizelySDKiOS-Universal or OptimizelySDKTVOS-Universal schemes. After building these schemes, the frameworks are output in the OptimizelySDKUniversal/generated-frameworks folder.

Contributing

Please see CONTRIBUTING.

Credits

First-party code (under OptimizelySDKCore/, OptimizelySDKDatafileManager/, OptimizelySDKEventDispatcher/, OptimizelySDKiOS/, OptimizelySDKShared/, OptimizelySDKTVOS/, OptimizelySDKUniversal/, OptimizelySDKUserProfileService/, ) is copyright Optimizely, Inc. and contributors, licensed under Apache 2.0.

Additional Code

FMDB https://github.com/ccgus/fmdb
License (MIT):: https://github.com/ccgus/fmdb/blob/master/LICENSE.txt Modfied: Yes Distributed: Yes Distribution: Binary

SQLITE3 https://www.sqlite.org/index.html
License (Public Domain):: https://www.sqlite.org/copyright.html Modfied: Yes Distributed: Yes Distribution: Binary

JSONModel https://github.com/jsonmodel/jsonmodel
License (MIT):: https://github.com/jsonmodel/jsonmodel/blob/master/LICENSEl Modfied: Yes Distributed: Yes Distribution: Binary

murmur3 https://github.com/PeterScott/murmur3l
License (Public Domain):: https://github.com/PeterScott/murmur3l Modfied: No Distributed: Yes Distribution: Binary