> For the complete documentation index, see [llms.txt](https://catchdocs.gitbook.io/catch-customer-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://catchdocs.gitbook.io/catch-customer-documentation/interactivity-catch/add-catch-to-another-app/ios-apps.md).

# iOS Apps

## Overview

The Catch Lite library is derived from the codebase of the existing Catch application, written in the Flutter framework. Core functionality from the main application is compiled as Native libraries, with releases synchronised with each release of the main Catch application,

## Installation

In Xcode, go to File > Add Package Dependencies...

<figure><img src="https://2966176008-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIFiiJXfTguvp4qi7HGaq%2Fuploads%2FwIKjDV9sk2MtbRdJ0lBk%2F1.png?alt=media&amp;token=a11d0245-bf6b-4e11-ad58-44ad4d8ef2af" alt=""><figcaption></figcaption></figure>

Paste the following URL in the search field of the Swift Package Manager dialog

```
https://github.com/<org>/catchlite-ios-lib
```

{% hint style="info" %}
This repository is private, and will require invitation from Catch's GitHub account. Please share your GitHub username with your account manager at Catch.
{% endhint %}

Choose the most recent Release from the dependency rule dropdown

<figure><img src="https://2966176008-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIFiiJXfTguvp4qi7HGaq%2Fuploads%2FlQ75OcJ8dzuHEjAlfX1z%2F2.png?alt=media&amp;token=216e7251-d16d-4b27-bee5-6c252cdde45f" alt=""><figcaption></figcaption></figure>

Add the `catchlite-ios-lib` package to your main application target

<figure><img src="https://2966176008-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIFiiJXfTguvp4qi7HGaq%2Fuploads%2FAh0TXalCC2fv6h2SoHoH%2F3.png?alt=media&amp;token=a5ff55be-63d1-4754-9b7e-a5c8fb15d390" alt=""><figcaption></figcaption></figure>

You will see CatchLite in your project's Package dependency list

<figure><img src="https://2966176008-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIFiiJXfTguvp4qi7HGaq%2Fuploads%2FandCnJ6JsUNnU9Ym9I2u%2F4.png?alt=media&amp;token=50c713ee-e132-448e-8740-d0eafb1b0528" alt=""><figcaption></figcaption></figure>

## Prerequisites

The following permissions are required to be decalred by the host app

* `NSBluetoothAlwaysUsageDescription`
* `NSBluetoothPeripheralUsageDescription`

The integrator app should define the user workflow for aquiring these permissions from the user, and handling their absence.

## Usage

```swift
import CatchLite
let catchLite = CatchClient()

// When a token has been retrieved from the Catch API, pass it to CatchLite here
// See "Authentication" page of this documentation for token retrieval
catchLite.setAuthToken("THE_AUTH_TOKEN_PROVIDED_BY_YOUR_SERVER")

// The below method may be called whenever the host app should show the Catch UI.
// The host app may wish to call this method after receiving the CatchEnvironmentDetected callback event
catchLite.present()
```

## Known Issues

* The following warning will be be presented at runtime, which may be diregarded. This issue originates from the library being compiled in debug mode.&#x20;

```
[ERROR:flutter/shell/platform/darwin/ios/framework/Source/FlutterDartVMServicePublisher.mm(126)] On iOS 14+, local network broadcast in apps need to be declared in the app's Info.plist. Debug and profile Flutter apps and modules host VM services on the local network to support debugging features such as hot reload and DevTools. To make your Flutter app or module attachable and debuggable, add a '_dartVmService._tcp' value to the 'NSBonjourServices' key in your Info.plist for the Debug/Profile configurations. For more information, see 
https://flutter.dev/docs/development/add-to-app/ios/project-setup#local-network-privacy-permissions
```
