AI Prompt
AI Setup

AI Agent Prompt

Generate a scoped prompt for an AI coding agent to add the Gleam iOS SDK features your app needs.

Last reviewed June 2, 2026

Generate The Prompt

Use this page when you want Codex, Cursor, Claude Code, or another coding agent to add the Gleam iOS SDK. The generator keeps the request limited to the supported v1 SDK surface and avoids unrelated management APIs or outbound webhook assumptions.

Choose your app stack and optional SDK features, then copy the generated prompt into your coding agent inside the iOS app repository.

AI Agent integration prompt

Choose the app stack and optional SDK features, then copy the prompt into your coding agent.

App stack

User access

Optional for apps with accounts

Generated prompt

3,067 chars

I am integrating the Gleam iOS SDK into an iOS app. Please implement the integration directly in this codebase.

Use only the supported Gleam SDK v1 surfaces needed for this integration: Portal WebView UI, native feedback Data API, custom announcement and notification APIs, anonymous sessions, signed identity, notification preferences, APNs device-token registration, server-sent test push, logout unregister, and notification deep-link routing.

Package:
- Add Swift Package Manager dependency: https://github.com/Gleam-land/gleam-ios-sdk.git
- Link the product named GleamSDK to the app target.

Configuration:
- Use projectId: YOUR_PROJECT_ID
- Use apiKey: YOUR_GLEAM_SDK_KEY
- These are client-safe values from Gleam dashboard Settings -> Integrations.
- Call Gleam.shared.configure(...) once during application startup.
- Call try await Gleam.shared.start() before presenting Portal UI.

Host app style:
- Use SwiftUI as the host app style.
- Configure Gleam in the @main App initializer.
- Present the Portal with GleamPortalFullScreenView inside a fullScreenCover.

Selected SDK features:

User access:
- Use no-login anonymous Gleam sessions.
- Do not require users to sign in before they can open the Gleam Portal.
- Do not add signed identity code or a Gleam-specific sign-in screen.

Native feedback UI:
- If I want a fully custom SwiftUI or UIKit feedback board, use Gleam.shared.fetchFeedback(limit:cursor:), submitFeedback(...), setFeedbackVote(...), and addFeedbackComment(...) after start() succeeds.
- Keep anonymous Gleam sessions as the no-login default so signed-out users can submit, vote, and comment.
- Use the hosted Portal preset when I want Gleam's official H5 feedback, roadmap, and announcements UI instead of custom native screens.

Announcements and notifications:
- If I want a custom update center, use Gleam.shared.fetchAnnouncements(), fetchLatestAnnouncements(), fetchNotifications(limit:unreadOnly:), getNotificationPreferences(), and setNotificationPreferences(...) after start() succeeds.
- Render announcements as the product update feed, notifications as the user-specific inbox, and preferences as reply/announcement push controls inside my app settings.
- Use notification polling as a foreground catch-up path even if APNs is enabled, and route tapped notifications with url(forNotification:) or url(forRemoteNotification:).

Diagnostics:
- Handle invalid_sdk_key, portalNotReady, identity_not_configured, unauthorized, and server errors.
- Log statusCode and requestId from Gleam server errors.
- Do not swallow setup failures silently in development builds.

Implementation constraints:
- Do not invent unsupported Gleam APIs, REST endpoints, webhooks, MCP tools, or management APIs.
- Do not put server-only secrets, APNs .p8 keys, or identity signing secrets in client code.
- Keep the integration minimal, production-safe, and aligned with the app's existing Swift concurrency and navigation patterns.
- After implementation, show the exact files changed and any manual Xcode capability steps I still need to perform.

Review The Output

After the agent finishes, review the generated code the same way you would review a teammate's SDK integration. The prompt is intentionally specific, but your app still owns permission timing, navigation placement, and release validation.

Before merging

  • Confirm the app imports the GleamSDK product from Swift Package Manager and does not vendor copied SDK code.
  • Confirm projectId and apiKey come from the intended Gleam dashboard project.
  • Confirm signed identity tokens are generated on your backend, never in the iOS client.
  • Confirm APNs registration only runs after your app has notification permission and the SDK session is ready.
  • Run the app on a simulator or device and open the Portal entry point from the real navigation surface.

Continue In The Docs