OptimizelySDKUserProfile 1.1.9

OptimizelySDKUserProfile 1.1.9

TestsTested
LangLanguage Obj-CObjective C
License Apache 2
ReleasedLast Release Aug 2017

Maintained by Optimizely FullStack.



  • By
  • Optimizely

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

  1. Add the following line to the Podfile:

    pod 'OptimizelySDK<platform>'
  2. Run the following command:

    pod install

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

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
OptimzielySDKUserProfile

The framework also embeds its third-party dependencies:

FMDB
JSONModel

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. The frameworks are output in the OptimizelySDKUniversal/generated-frameworks folder.

Contributing

Please see CONTRIBUTING.