Feedback API
iOS SDK

Native Feedback API

Build a custom SwiftUI or UIKit feedback board with Gleam SDK methods for boards, posts, votes, comments, and no-login sessions.

Last reviewed June 2, 2026

Choose The Feedback Mode

Gleam supports two iOS feedback modes. Use the Portal preset when you want the official hosted H5 experience for feedback, roadmap, announcements, and detail pages. Use the native feedback API when your app should own the SwiftUI or UIKit feedback interface.

Both modes use the same SDK session. A no-login app can call start(), receive an anonymous Gleam session, and let users submit, vote, and comment without building a separate account screen.

ModeUse whenMain SDK surface
Portal presetYou want Gleam's official feedback, roadmap, announcements, routing, and moderation UI.GleamPortalFullScreenView and UIKit presentFeedback/presentRoadmap helpers.
Native custom UIYou want a first-party SwiftUI or UIKit feedback board with your own layout and navigation.fetchFeedback, submitFeedback, setFeedbackVote, and addFeedbackComment.

Core Flow

Configure the SDK once, call start(), then render the returned boards and posts in your app. The SDK adds the project headers and session bearer token for write calls.

For signed-in apps, add identify(signedIdentityToken:) after your backend can issue HS256 identity tokens. Keep the anonymous session path as the fallback for signed-out users.

Fetch and render feedback

try await Gleam.shared.start()

let page = try await Gleam.shared.fetchFeedback(limit: 20)

for board in page.boards {
  print("Board: \(board.name)")
}

for post in page.posts {
  print("\(post.title): \(post.voteCount) votes")
}

if let nextCursor = page.nextCursor {
  let nextPage = try await Gleam.shared.fetchFeedback(
    limit: 20,
    cursor: nextCursor
  )
  print("Loaded \(nextPage.posts.count) more posts")
}

Submit, vote, and comment

let post = try await Gleam.shared.submitFeedback(
  title: "Add dark mode",
  content: "The editor is too bright at night.",
  boardId: page.boards.first?.id
)

let updatedPost = try await Gleam.shared.setFeedbackVote(
  postId: post.id,
  voted: true
)

let comment = try await Gleam.shared.addFeedbackComment(
  postId: updatedPost.id,
  body: "I can help test this."
)

print(comment.id)

Models

The models are intentionally small so a native screen can bind them directly to SwiftUI state or UIKit view models.

ModelImportant fields
GleamFeedbackPageboards, items, nextCursor
GleamFeedbackBoardid, name, description, color
GleamFeedbackPostid, title, content, boardId, status, voteCount, commentCount, imageURLs, viewerHasVoted, createdAt, updatedAt
GleamFeedbackDrafttitle, content, boardId, imageURLs
GleamFeedbackCommentid, postId, parentId, body, imageURLs, createdAt
GleamFeedbackCommentDraftbody, parentId, imageURLs

Server Behavior

The feedback API only returns posts and boards visible to the public Portal. Newly submitted posts and comments use the same Gleam moderation, notification, and follow-up pipeline as the hosted Portal.

Write calls require an SDK session token, but that token can come from the anonymous no-login bootstrap. Apps with existing accounts can upgrade the session with signed identity when account context is available.

Keep in mind

  • Call start() before any feedback method.
  • Use the returned board IDs instead of hard-coding board names.
  • Handle unauthorized by refreshing the SDK session and retrying once.
  • Do not send service-role keys, identity signing secrets, or dashboard tokens from the app.
  • Use the Portal preset for roadmap and announcement detail routes unless your app deliberately owns those screens too.

REST Contract

The Swift methods wrap the SDK REST v1 feedback endpoints. Most iOS apps should call the Swift API directly, but the endpoints are useful for debugging traffic and backend logs.

MethodPathAuthPurpose
GET/sdk/v1/project/{projectPathId}/feedbackOptional Bearer tokenList public feedback posts, visible boards, counts, and viewer vote state for a native feedback UI.
POST/sdk/v1/project/{projectPathId}/feedbackBearer tokenCreate a feedback post from the current SDK session, including anonymous no-login sessions.
PUT/sdk/v1/project/{projectPathId}/feedback/{postId}/voteBearer tokenSet or clear the current SDK user's vote for a feedback post.
POST/sdk/v1/project/{projectPathId}/feedback/{postId}/commentsBearer tokenAdd a visible comment to a feedback post from the current SDK session.