Skip to main content

Installation

This guide provides step-by-step instructions to integrate the AppTrove iOS SDK into your iOS application using CocoaPods or Swift Package Manager. Choose the installation method that best suits your project.

Prerequisites

  • iOS 10.0 or later
  • Xcode 12.0 or later
  • CocoaPods (for Option 1) or Swift Package Manager support (for Option 2)
  • A Trackier MMP account with an SDK key
  • Access to your project's Podfile (for CocoaPods) or Xcode project settings

Installation

Choose one of the following installation methods:

Option 1: CocoaPods

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'

Package Information:

  • CocoaPods Package: trackier-ios-sdk
  • Installation Command: pod 'trackier-ios-sdk'
  • Version: 1.6.75 (latest)

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.

CocoaPods

If you're new to CocoaPods, refer to the official CocoaPods documentation for guidance on creating and using Podfiles.


Option 2: Swift Package Manager

The AppTrove iOS SDK supports Swift Package Manager (SPM) for dependency management.

Step 1: Add Package Dependency

1.1 Open Xcode Package Dependencies

  1. Open your project in Xcode
  2. Go to FileAdd Package Dependencies...

Add iOS Package

1.2 Enter Repository URL

Enter the repository URL:

https://github.com/ApptroveLabs/Trackier_iOS_SDK.git
  1. Select the version rule (e.g., "Up to Next Major Version" with 1.6.75)
  2. Click "Add Package"

Xcode will verify the package:

Verifying Trackier iOS SDK

1.3 Add SDK Product to Target

  1. Select the TrackierSDK product and add it to your target
  2. Click "Add Package" again to confirm

Step 2: Add Framework to Target

After adding the package, you need to link the framework:

2.1 Open Project Settings

  1. Open your project in Xcode
  2. Select your project in the navigator (top-level item)
  3. Select your target (e.g., "iOS Simulator")
  4. Go to "General" tab
  5. Scroll to "Frameworks, Libraries, and Embedded Content"

2.2 Add TrackierSDK Framework

  1. Click the "+" button
  2. Search for TrackierSDK

Add Framework from Project

  1. Select TrackierSDK and click "Add"

2.3 Verify Framework Integration

Verify that TrackierSDK appears in the frameworks list:

Verify Framework

Step 3: Import SDK in Your Code

After successful installation, import the SDK in your Swift files:

import TrackierSDK
SPM Repository

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:
    git clone https://github.com/ApptroveLabs/Trackier_iOS_SDK.git
  2. Navigate to the Example directory
  3. Open the project in Xcode
    • For CocoaPods: Run pod install and open the .xcworkspace file
    • For SPM: The dependencies will be automatically resolved by Swift Package Manager

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.