Coder Social home page Coder Social logo

learnwithhomer / objective-c-sdk Goto Github PK

View Code? Open in Web Editor NEW

This project forked from optimizely/objective-c-sdk

0.0 11.0 0.0 252.06 MB

Optimizely X Objective-C SDK for iOS and tvOS

License: Apache License 2.0

Makefile 0.09% Swift 1.72% Objective-C 95.98% Ruby 0.46% C 0.72% Shell 0.95% Awk 0.07%

objective-c-sdk's Introduction

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.1'
  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.1"
  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

objective-c-sdk's People

Contributors

alda-optimizely avatar aliabbasrizvi avatar arafay-folio3 avatar ceimaj avatar elliotykim avatar haleybash-optimizely avatar kellyroach-optimizely avatar mikeproeng37 avatar msohailhussain avatar ooola avatar thomaszurkan-optimizely avatar tprevost-phunware avatar wangjoshuah avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.