iOS SDK Quickstart
Install the Gleam Swift package, configure the SDK, start the session, and present the Portal from SwiftUI or UIKit.
Use An AI Agent First
Using Codex, Cursor, Claude Code, or another coding agent? Start with the AI Agent Prompt page and let the agent add Gleam to your app.
Requirements
The Gleam iOS SDK is distributed as a Swift Package and supports iOS 15 or later. The public product target is named GleamSDK.
| Requirement | Value |
|---|---|
| Package URL | https://github.com/gleamland/gleam-ios-sdk.git |
| Minimum iOS | iOS 15 |
Install With Swift Package Manager
In Xcode, open File -> Add Package Dependencies, paste the package URL, and link the GleamSDK product to your app target.
Package URL
https://github.com/gleamland/gleam-ios-sdk.gitConfigure And Start
Initialize the SDK once during application startup. The project ID and SDK key are client-safe values from Settings -> Integrations in the Gleam dashboard.
Call start() before presenting Portal UI. It resolves the hosted Portal URL, confirms capabilities, and prepares the WebView path used by the SDK.
Application startup
Choose the app lifecycle your iOS app already uses.
import SwiftUI
import GleamSDK
@main
struct MyApp: App {
init() {
do {
try Gleam.shared.configure(
GleamConfiguration(
projectId: "YOUR_PROJECT_ID",
apiKey: "YOUR_GLEAM_SDK_KEY"
)
)
#if DEBUG
Gleam.shared.setLogLevel(.debug)
#endif
Task {
try await Gleam.shared.start()
}
} catch {
assertionFailure("Failed to configure Gleam: \(error)")
}
}
var body: some Scene {
WindowGroup {
ContentView()
}
}
}Present The Portal
Use the SwiftUI full-screen view for a native presentation, or call the UIKit convenience methods from an existing view controller.
Portal presentation
Use the same project configuration; only the presentation layer changes.
import SwiftUI
import GleamSDK
struct ContentView: View {
@State private var showFeedback = false
var body: some View {
Button("Send Feedback") {
showFeedback = true
}
.fullScreenCover(isPresented: $showFeedback) {
GleamPortalFullScreenView(section: .feedback)
}
}
}Next Steps
Identify signed-in users
Exchange a backend-signed identity token when your app already knows the current user.
Read announcements and notifications
Use SDK methods for in-app updates, inbox polling, and notification preferences.
Register APNs tokens
Forward APNs device tokens and notification payloads to Gleam after your app owns notification permission.