# Installation

Detour provides a native iOS SDK (`Detour`) for deferred links, universal links, and custom scheme links.

:::note[Beta]
iOS SDK `1.0.2` is currently in beta. APIs and integration details may still change before stable release.
:::

Before installation, make sure your app is created in the Detour Dashboard and you have:

- `appID` from **API configuration**
- publishable `apiKey` from **API configuration**
- iOS link integration snippets from **App configuration**

## Requirements

- iOS `13+`
- Swift `5.5+`

## Install with Swift Package Manager

In Xcode:

1. Open your project.
2. Go to `File > Add Package Dependencies...`
3. Enter repository URL:
   - `https://github.com/software-mansion-labs/ios-detour`
4. Add product `Detour` to your app target.

Or in `Package.swift`:

```swift
.package(url: "https://github.com/software-mansion-labs/ios-detour", from: "1.0.2")
```

## Install with CocoaPods

In your `Podfile`:

```ruby
platform :ios, '13.0'

target 'YourAppTarget' do
  use_frameworks!
  pod 'Detour', '1.0.2'
end
```

Then run:

```bash
pod install
```

## Prepare app configuration

```swift
import Detour

let detourConfig = DetourConfig(
    apiKey: "<YOUR_DETOUR_API_KEY>",
    appID: "<YOUR_DETOUR_APP_ID>",
    shouldUseClipboard: true,
    linkProcessingMode: .all
)
```

## Configure link capabilities

Add both integration pieces from Dashboard/App config:

- custom URL scheme in `Info.plist` (`CFBundleURLTypes`)
- associated domains in entitlements (`applinks:<your-domain>`)

Without those entries, iOS will not dispatch runtime links to your app.

## Privacy manifest

The `1.0.x` line ships no `PrivacyInfo.xcprivacy`. Apple expects the app bundle
to declare what every third-party SDK collects, so on this version you add the
declarations to your own app's manifest. `1.1.1` and later ship one with the
package.

The data types to declare, and the matching App Store Connect answers, are
listed in [Privacy](https://detour.swmansion.com/docs/sdk/ios/privacy).

## Next steps

1. Wire startup/runtime handling in [Usage](https://detour.swmansion.com/docs/sdk/ios/sdk-usage).
2. Use the runnable template from [Examples](https://detour.swmansion.com/docs/sdk/ios/examples).