> ## Documentation Index
> Fetch the complete documentation index at: https://feddy.app/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# UIKit

> Add Feddy to a UIKit app with Swift Package Manager and send your first message.

By the end of this page your app will have a Support button that opens Feddy, and a message sent from it will be sitting in your inbox. It takes about five minutes.

## Before you start

* A Feddy project and its project ID. You'll find the ID under **Settings → Install** in the dashboard. No project yet? [Create one](/docs/getting-started/create-a-project) first.
* Xcode 15 or later. The SDK supports iOS 15 and up and doesn't pull in any other packages.

<Steps>
  <Step title="Add the package">
    In Xcode, choose **File → Add Package Dependencies…** and paste this URL:

    ```
    https://github.com/FeddyLab/feddy-ios
    ```

    If you manage dependencies in a `Package.swift` file instead, add:

    ```swift theme={null}
    .package(url: "https://github.com/FeddyLab/feddy-ios", from: "0.7.0")
    ```
  </Step>

  <Step title="Tell Feddy which project this is">
    Do this once, when the app launches, before anything else can open Feddy. Calling it again later does nothing.

    ```swift AppDelegate.swift theme={null}
    import Feddy

    func application(_ application: UIApplication,
                     didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        Feddy.configure(projectId: "fd_XXXXXXXXXXXXXXXX")
        return true
    }
    ```

    <Note>
      **The project ID isn't a secret.** It's built into your app, so anyone who downloads the app can find it, and that's fine: it only tells Feddy which inbox a message belongs to. Commit it to your repository like any other setting. There's nothing to protect, so keep it out of your secrets file.
    </Note>
  </Step>

  <Step title="Give users a way in">
    Call `present()` from wherever users go looking for help. For most apps that's a row in Settings or a bar button. Feddy slides up over the current screen, showing the user's past conversations and a button to start a new one.

    ```swift SettingsViewController.swift theme={null}
    @objc func helpTapped() {
        Feddy.present()
    }
    ```

    To show a count on that button when a reply is waiting, give Feddy a function to call whenever the number changes. It runs on the main thread, so you can update the UI directly:

    ```swift theme={null}
    Feddy.onUnreadCountChanged = { count in
        helpItem.badgeValue = count > 0 ? "\(count)" : nil
    }
    ```
  </Step>

  <Step title="Send yourself a message">
    Run the app, tap the button, and send a message. Then open your inbox at [dash.feddy.app](https://dash.feddy.app): it's there, with the device model and app version alongside.

    Reply from the inbox. Back in the app, the reply appears in the conversation, and the button shows a `1` until the user opens it.

    <Check>
      That's the whole loop: a user writes in, you answer, and the answer reaches them inside the app.
    </Check>
  </Step>
</Steps>

## Next steps

<CardGroup cols={2}>
  <Card title="Identify users" href="/docs/guides/identify-users">
    Tell Feddy who's logged in, so you see their name in the inbox and replies can reach them by email.
  </Card>

  <Card title="Unread badge" href="/docs/guides/unread-badge">
    Keep the count fresh when the app comes back to the foreground, and other placements.
  </Card>

  <Card title="Conversations" href="/docs/concepts/conversations">
    What you're looking at in the inbox, and what happens on its own.
  </Card>

  <Card title="iOS SDK reference" href="/docs/reference/ios">
    Every call in the package, with its signature and what it does.
  </Card>
</CardGroup>
