DocumentationiOS · Swift

iOS with Swift integration

Native feedback for your Apple app.

SwiftUI feedback flows, automatic app and device context, offline delivery, and read-only team replies in one Swift package.

Before you begin

A project, a key, and your app.

Create a project in Heardock and copy its hd_pub_ publishable key. The key identifies the project and is safe to include in your client.

Create a project
  • iOS 17+
  • Swift 5.9+
  • Xcode with Swift Package Manager
01

Add the Swift package

The package is indexed on Swift Package Index. In Xcode, choose File → Add Package Dependencies…, paste the GitHub repository URL, select version 0.1.0, and add HeardockCore and HeardockUI to your app target.

Swift Package Manager
https://github.com/songsiyao/heardock-ios.git
02

Configure Heardock once

Configure the shared client during app startup. Both the bundled UI and any headless calls use this same instance.

MyApp.swift
import HeardockCore
import HeardockUI

@main
struct MyApp: App {
    init() {
        Heardock.shared.configure(HeardockConfig(
            publicKey: "hd_pub_your_key",
            baseURL: URL(string: "https://heardock.com")!
        ))
    }

    var body: some Scene {
        WindowGroup { ContentView() }
    }
}
03

Add the feedback entry point

Place HeardockFeedbackView inside a NavigationStack. The full-page presentation is the default; the host provides navigation and the back action.

ContentView.swift
NavigationStack {
    NavigationLink("Send feedback") {
        HeardockFeedbackView()
    }
}
04

Present as a sheet instead

Use the sheet presentation when that fits your app better. Heardock adds the grabber and close button while sharing the same form and submission logic.

ContentView.swift
.sheet(isPresented: $showingFeedback) {
    HeardockFeedbackView(presentation: .sheet)
}
05

Localize and identify optionally

English and Simplified Chinese are built in. String overrides are partial. User identity is never attached unless you explicitly provide it.

Configuration.swift
Heardock.shared.configure(HeardockConfig(
    publicKey: "hd_pub_your_key",
    locale: "zh-CN",
    strings: ["title": "告诉我们你的想法", "send": "提交"]
))

Heardock.shared.identify(
    id: "u_123",
    email: "bob@example.com",
    name: "Bob"
)

Verify the integration

Send one note. Check the whole loop.

  • Open the form and select a category.
  • Submit a short test message from a debug build.
  • Confirm the note and its context appear in your Heardock inbox.
  • Reply from the inbox and check the app’s feedback history.
Open the inbox
Next integrationAndroid with Kotlin