iOS / tvOS

Apptimize supports experimentation and release management on iOS and tvOS through two separate SDKs. They are managed and released together and the installation instructions are very similar.

SDK Installation

Sign in or Register for Apptimize. You’ll see a welcome page that asks for the name of your app. After entering all your info, you’ll see these installation instructions again.

You have three options for installing the iOS/tvOS SDK:

  1. Manual (Zero-Line) Installation
  2. CocoaPods
  3. Segment or mParticle Integration Kit

Manual (Zero-Line) Installation

The SDK switched from static to dynamic at version 2.18.0. Please remove the SDK from your project and follow the installation instructions below to upgrade.

  1. After you’re signed in, you’ll be able to download the Apptimize iOS/tvOS SDK. Unzip it, then drag and drop Apptimize.framework (iOS) or ApptimizeTV.framework (tvOS) into your project. You’ll probably want to check the Copy items if needed option.
../_images/AddFramework.png
  1. Select the project and go to the General tab. Drag the Apptimize.framework or ApptimizeTV.framework from the project browser into the Embedded Binaries section at the bottom of the page.
../_images/AddEmbedded.png

CocoaPods

Refer to CocoaPod’s Getting Started Guide for detailed instructions.

  1. Once you have created your Podfile, insert pod 'Apptimize' (iOS) or pod 'Apptimize-tvOS' (tvOS) to import Apptimize as a dependency.

    Once you have done so, re-run pod install from the command line. Apptimize.framework is compatible with use_frameworks! for other dynamic and Swift dependencies.

Initializing Apptimize

  1. Open your project’s Info.plist (typically found in the Supporting Files folder), navigate to the Editor menu, and choose Add Item. If Add Item is grayed out, make sure to click the main window.
../_images/AddEditorItem-1.png

Make sure to name your new entry ApptimizeAppKey.

../_images/AddApptimizeAppKey.png
  1. Add your application key, which is a 31 character key that can be found on the installation instructions while logged in or in your app settings.
../_images/SetApptimizeAppKey.png
  1. In order to release on the App Store, you will need to strip all simulator architectures from the framework. In the Build Phases of your project target, click the + sign and select New Run Script Phase.
../_images/ios_addrunscript.png

Be sure the new run script is below the Embed Frameworks build phase.

Then, add the following code to the newly created Run Script:

cd "${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/Apptimize.framework/"
if [[ ! "${SDKROOT}" == *Simulator* ]]; then
  lipo Apptimize -verify_arch i386 && lipo -remove i386 -remove x86_64 Apptimize -output Apptimize || echo "Simulator architectures already stripped"
else
  lipo Apptimize -verify_arch i386 || { echo "Simulator architectures missing - clean and rebuild for simulator!"; exit 1; }
fi
  1. Build your app to make sure that SDK was installed correctly. Verify that the SDK is loading by running your app and checking the Xcode console for the message Apptimize: Version x.x.x.

    You’ve finished the Apptimize installation and are ready to configure your first A/B experiment!

Segment or mParticle Integration Kit

You can install our iOS SDK via our Segment or mParticle Integration Kits. You might want to use this option if you’re already tracking similar data with other services. This way, you can send your data to Segment or mParticle and with a flip of a switch, it will show up in Apptimize as well.

Learn more about our Integration Kits here!