SwiftUI
Add Feddy to a SwiftUI app with Swift Package Manager and send your first message.
By the end of this page your app has a support entry point, and a message sent from it shows up in your Feddy inbox.
Prerequisites
- A Feddy project and its project ID from Settings → Install. Create a project if you have none.
- Xcode 15 or later. The SDK targets iOS 15 and has no third-party dependencies.
Install
In Xcode choose File → Add Package Dependencies… and paste:
https://github.com/FeddyLab/feddy-iosOr add it to Package.swift:
.package(url: "https://github.com/FeddyLab/feddy-ios", from: "0.7.0")Initialize
Call configure once, before any other Feddy call. Later calls are ignored.
import Feddy
@main
struct MyApp: App {
init() {
Feddy.configure(projectId: "fd_XXXXXXXXXXXXXXXX")
}
var body: some Scene { WindowGroup { ContentView() } }
}The project ID ships inside your binary and is public by design. Commit it. Do not put it in a secrets file or an environment variable.
Add an entry point
Put a row where users already look for help, usually in Settings:
Form {
Button("Support") { Feddy.present() }
.feddyUnreadBadge()
}present() opens the conversation list as a sheet over whatever is on screen. presentNewConversation() skips the list and opens the compose form.
Verify
Run the app, open the row, and send a message. It appears in your Feddy inbox. Reply from the inbox; the reply shows up in the sheet and the row’s badge shows 1 until the user reads it.
Next steps
- Identify users so replies can also reach them by email and you see who wrote in.
- Unread badge for a custom row or a tab bar item.
- iOS SDK reference for every public call.