This guide will help you install and set up the Linkrunner SDK in your native iOS application.

Requirements

  • iOS 15.0 or higher
  • Swift 5.9 or higher
  • Xcode 14.0 or higher

Installation

Swift Package Manager

The Linkrunner SDK can be installed via Swift Package Manager (SPM), which is integrated directly into Xcode.

  1. In Xcode, select FileAdd Package Dependencies…
  2. Enter the following repository URL:
    https://github.com/linkrunner-labs/linkrunner-ios.git
    
  3. Select the version you want to use (we recommend using the latest version)
  4. Click Add Package

Alternatively, you can add the package dependency to your Package.swift file:

dependencies: [
    .package(url: "https://github.com/linkrunner-labs/linkrunner-ios.git", from: "1.0.0")
]

And add the dependency to your target:

targets: [
    .target(
        name: "YourApp",
        dependencies: [
            .product(name: "Linkrunner", package: "linkrunner-ios")
        ]
    )
]

Importing in Swift

After installation, you can import the SDK in your Swift files:

import Linkrunner

Required Permissions

App Tracking Transparency

If you plan to use IDFA (Identifier for Advertisers), you need to request permission from the user through App Tracking Transparency. Add the following to your Info.plist file:

<key>NSUserTrackingUsageDescription</key>
<string>This identifier will be used to deliver personalized ads and improve your app experience.</string>

Network Access

The SDK requires network access to communicate with Linkrunner services. Make sure your app has the appropriate permissions for network access.

Configuring sending postback copies to Linkrunner

To enable SKAdNetwork postback copies to be sent to Linkrunner, you need to configure the NSAdvertisingAttributionReportEndpoint in your app’s Info.plist file:

  1. Select the Info.plist file in the project navigator in Xcode.
  2. Add the new key to the properties list.
  3. Enter the key name NSAdvertisingAttributionReportEndpoint.
  4. Enter the String property type.
  5. In the property value, enter https://linkrunner-skan.com

This configuration allows Apple to send copies of SKAdNetwork postbacks to Linkrunner, enabling better attribution tracking for your iOS campaigns.

Next Steps

After installation, proceed to the Usage Guide to learn how to initialize and use the Linkrunner SDK in your iOS application.