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.
- iOS 17+
- Swift 5.9+
- Xcode with Swift Package Manager
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.
https://github.com/songsiyao/heardock-ios.gitConfigure Heardock once
Configure the shared client during app startup. Both the bundled UI and any headless calls use this same instance.
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() }
}
}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.
NavigationStack {
NavigationLink("Send feedback") {
HeardockFeedbackView()
}
}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.
.sheet(isPresented: $showingFeedback) {
HeardockFeedbackView(presentation: .sheet)
}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.
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.
