Use the native SwiftUI SDK for iOS 17+ and macOS 14+. The package uses Swift tools 5.9 or newer.
Add the package
Add the public package with Swift Package Manager. Version 1.0.1 is a tagged release:
.package(url: "https://github.com/AppGram/apple-sdk.git", from: "1.0.1")
Add the AppGramSDK library product to your application target. The imported module is AppGramSDK, with that capitalization.
Configure and open feedback
Configure the singleton on the main actor before requesting a view. Replace the project ID:
import SwiftUI
import AppGramSDK
@main
@MainActor
struct FeedbackApp: App {
init() {
AppGramSDK.shared.configure(projectId: "YOUR_PROJECT_ID")
}
var body: some Scene {
WindowGroup {
NavigationStack {
if let feedback = try? AppGramSDK.shared.feedbackView() {
feedback
} else {
Text("Configure AppGram before opening feedback.")
}
}
}
}
}
The view factory throws when the SDK is not configured. The example handles that failure instead of force-unwrapping the result.
Before testing the view, create and approve the sample request in Getting started. Confirm it appears, cast a vote, and refresh the same request in the dashboard to check the saved count. An empty successful response can mean the project has no approved feedback.
Identify the current customer
After sign-in, you can supply customer context:
AppGramSDK.shared.setUser(
userId: "customer-123",
email: "[email protected]",
name: "Alex"
)
// When the customer signs out:
AppGramSDK.shared.clearUser()
Customer context associates feedback and support activity; it does not grant management permissions. Send only the fields your application needs.
Other views and configuration
The Swift reference documents the available view factories, services, configuration types, and models. For releases and announcements, consult AnnouncementConfiguration and its organization and project slugs. baseURL accepts the API origin and defaults to https://api.appgram.dev.