Install SDK

Learn how to download and install the iOS SDK.

Before you begin

You need Xcode to follow along with these guides.

Download and install the SDK

Download and install the iOS SDK with your package manager of choice.

Install using CocoaPods

Recommended

Step 1: Download CocoaPods
Download and install the latest version of CocoaPods.

Step 2: Add dependencies
Add the latest version of AppsFlyerFramework to your project's Podfile:

pod 'AppsFlyerFramework'

Step 3: Install dependencies
In your terminal, navigate to your project's root folder and run pod install.

Step 4: Open Xcode workspace
In Xcode, use the .xcworkspace file to open the project from this point forward, instead of the .xcodeproj file.

If you are developing a tvOS app, CocoaPods automatically adds the relevant dependencies from AppsFlyerFramework.

Install using Carthage

Step 1: Install Carthage
Install the latest version of Carthage.

Step 2: Add dependencies
Add the following line to your Cartfile binary:

binary "https://raw.githubusercontent.com/AppsFlyerSDK/AppsFlyerFramework/master/Carthage/appsflyer-ios.json"

Currently doesn't support tvOS apps.

📘

Note

The link above links to a static library. If you're upgrading to a newer iOS version, do the following:

  1. Remove the Run Script stage from Xcode that runs copy-frameworks.
  2. Make sure the library is not embedded.

To learn more, see Carthage docs.

Install using Swift Package Manager (V6.1.0+)

Starting V6.1.0 the iOS SDK can be installed via Install using Swift Package Manager (SPM):
Step 1: Navigate to Add Package Dependency
In Xcode, go to File > Swift Packages > Add Package Dependency:

Step 2: Add iOS SDK GitHub repository
Enter the AppsFlyer SDK GitHub repository:
https://github.com/AppsFlyerSDK/AppsFlyerFramework

Step 3: Select SDK version

Step 4: Add AppsFlyerLib to desired Target

Manual install

Step 1: Download static framework
Download the iOS SDK as a static framework.

To verify the integrity of the SDK static framework download, click here.

Step 2: Unzip
Unzip the AppsFlyerLib.framework.zip file you just downloaded.

Step 3: Import in project
Drag the AppsFlyerLib.framework file and drop it into your Xcode project. Make sure Copy items if needed is checked.

📘

Note

This approach is only compatible with iOS 8 and above. For tvOS apps, you need a different AppsFlyerFramework:

  1. Clone this repo.
  2. Find AppsFlyerLib.framework in this folder of the cloned repo.
  3. Repeat step 3.

Native iOS framework dependencies

The SDK automatically adds and uses the following native frameworks:

  • AdSupport framework: This framework is required to collect the IDFA from devices. Without IDFA you cannot attribute installs to Facebook Ads, Twitter, Google ads, and other networks
  • iAd framework: Measure performance of Apple Search Ads in your app
  • AdServices framework (V6.1.3+): Measure the performance of Apple Search Ads in your app

Strict mode SDK

Use the Strict Mode SDK to completely remove IDFA collection functionality and AdSupport framework dependencies (for example, when developing apps for kids).

You can install the Strict mode SDK using one of the following methods.
Install using CocoaPods

pod 'AppsFlyerFramework/Strict'

Install using Carthage

binary "https://raw.githubusercontent.com/AppsFlyerSDK/AppsFlyerFramework/master/Carthage/appsflyer-strict.json" ~> 6.3.2

Did this page help you?