Skip to main content

Installation

This guide provides step-by-step instructions to integrate the AppTrove iOS SDK into your iOS application using CocoaPods. It covers adding the SDK dependency and configuring AppTrackingTransparency for IDFA collection.

Prerequisites

  • iOS 10.0 or later
  • Xcode 12.0 or later
  • CocoaPods installed for dependency management
  • A Trackier MMP account with an SDK key
  • Access to your project's Podfile and Info.plist

Installation

Step 1: Add AppTrove SDK via CocoaPods

To integrate the AppTrove iOS SDK, configure your Podfile to include the SDK dependency.

1.1 Update the Podfile

In your project's Podfile, add the following line:

pod 'trackier-ios-sdk'

1.2 Install Dependencies

Run the following command in the terminal from your project directory:

pod install

1.3 Open the Workspace

Open the generated .xcworkspace file in Xcode to build and run your project.


Step 2: Configure AppTrackingTransparency (Optional)

For apps targeting iOS 14.5 and later, you must request user permission to access the Identifier for Advertisers (IDFA) using Apple's AppTrackingTransparency (ATT) framework.

2.1 Add Permission Description

Add the following key-value pair to your Info.plist to describe why your app needs tracking permission:

<key>NSUserTrackingUsageDescription</key>
<string>We use tracking to personalize your experience and improve our services.</string>

2.2 Request Tracking Permission

In your app (e.g., in AppDelegate or a view controller), request tracking authorization. Below is an example implementation:

import AppTrackingTransparency

func requestTrackingPermission() {
if #available(iOS 14, *) {
ATTrackingManager.requestTrackingAuthorization { status in
switch status {
case .authorized:
print("Tracking authorized")
case .denied:
print("Tracking denied")
case .notDetermined:
print("Tracking not determined")
case .restricted:
print("Tracking restricted")
@unknown default:
print("Unknown tracking status")
}
}
}
}
note

Call requestTrackingPermission() at an appropriate time in your app's lifecycle, such as during onboarding or when tracking is needed.


Example Application

For a sample implementation, refer to the Example directory in the AppTrove iOS SDK GitHub repository. To explore the example project:

  1. Clone the repository.
  2. Navigate to the Example directory.
  3. Run pod install to set up dependencies.
  4. Open the generated .xcworkspace file in Xcode to build and run the app.

Next Steps

After completing the installation:

  1. Initialize the AppTrove SDK in your app.
  2. Test your integration to ensure proper tracking of installs and events.
  3. Contact Trackier support at support@trackier.com for assistance.

For the latest version of the AppTrove iOS SDK and additional resources, visit the Trackier Documentation Portal.