Skip to content
Mobile Joe Docs Dashboard
View Markdown

iOS · SwiftUI · SDK 1.0.1

FAQs

Give app users answers inside your app, with an optional email link for further help.

Complete the iOS quickstart first. These examples assume Mobile Joe is configured and MobileJoeUI is added to your app target.

Publish answers

In the dashboard, open FAQs, create a FAQ, and choose Publish → Publish now. The SDK receives live FAQs in dashboard order, with translations when available.

Add navigation

The quickstart example pushes FAQView with .inNavigationStack onto your app's navigation stack. The view lists the question titles; tapping one opens its answer.

Present a sheet

For a help button elsewhere in your app, use .asSheet. It supplies a navigation stack and close button:

import SwiftUI
import MobileJoeUI

struct HelpButton: View {
  @State private var showingFAQs = false

  var body: some View {
    Button("Help") { showingFAQs = true }
      .sheet(isPresented: $showingFAQs) {
        FAQView(
          presentationMode: .asSheet,
          configuration: .standard(recipient: "support@example.com")
        )
      }
  }
}

Offer email support

A nonempty recipient adds a support hint and email link below the list of questions and below each answer. Replace support@example.com with your address, or use .standard(recipient: "") to hide both. The link opens the user's email app.

For your own localized wording, use FAQView.Configuration(recipient:subject:body:contactSupportMailToLabel:contactSupportHint:). The subject and body are optional; the label and hint accept LocalizedStringResource values.

Loading and custom UI

The standard view loads on appearance and supports pull to refresh. It includes loading, empty, and failure states; a failed refresh keeps the questions already shown.

For your own interface, import MobileJoe, keep an observable FAQs() model in @State, and call try await faqs.load() on the main actor after configuration. Read the returned FAQItem values from faqs.all; each exposes id, title, and body. Handle loading errors in your interface. You can also pass your model to FAQView(faqs:presentationMode:configuration:).

Verify

Open a published question, edit it in the dashboard, and pull to refresh. Test the support link on a device with email configured. If no questions appear, follow Troubleshooting.