Skip to content
Mobile Joe Docs Dashboard
View Markdown

iOS · SwiftUI · SDK 0.0.24

iOS quickstart

Install Mobile Joe and display a FAQ published from your dashboard.

Before you start

  • An iOS app using SwiftUI, with iOS 17+, Swift 6.2+, and Xcode 26+.
  • A Mobile Joe account with API access and an app created in the dashboard.
  • The public SDK API key from that app's App Settings. The Set up SDK page provides the configuration below with your key already filled in.

This guide uses SDK 0.0.24. Choose this exact package version so the examples match the installed SDK.

Install the SDK

  1. In Xcode, choose File → Add Package Dependencies….
  2. Enter this package URL:
https://github.com/MobileJoeDev/mobilejoe-ios.git

Set the dependency rule to Exact Version, enter 0.0.24, and add both MobileJoe and MobileJoeUI to your app target.

Configure your app

In your existing SwiftUI App type, import MobileJoe and configure it in .task at startup. Keep your app's existing name and root view.

import SwiftUI
import MobileJoe

@main
struct MyApp: App {
  var body: some Scene {
    WindowGroup {
      ContentView()
        .task {
          try? await Joe.configure(withAPIKey: "YOUR_API_KEY")
        }
    }
  }
}

Replace YOUR_API_KEY with the key for the same dashboard app whose content you want to show.

configure is async throws. This minimal example ignores errors with try?; use do/catch to handle them. Await configuration before starting dependent SDK operations.

Add the FAQ screen

Replace your starter ContentView with this example, or add its navigation link to your existing NavigationStack.

import SwiftUI
import MobileJoeUI

struct ContentView: View {
  var body: some View {
    NavigationStack {
      List {
        NavigationLink("FAQs") {
          FAQView(
            presentationMode: .inNavigationStack,
            configuration: .standard(recipient: "")
          )
        }
      }
      .navigationTitle("Help")
    }
  }
}

FAQView loads its own data. Use .inNavigationStack when the surrounding navigation stack is provided by your app. The empty support recipient hides the email contact link; replace it with your support address to show that link.

Verify your integration

  1. Select the matching app in the dashboard and open FAQs.
  2. Create a FAQ with a recognizable question and answer, then publish it.
  3. Build and run your iOS app. Open FAQs from the Help screen.
  4. Confirm that your published question appears. Open it and check the answer.
  5. Edit the answer in the dashboard, then pull to refresh the FAQ list in your app. The updated answer should be available.

A successful integration displays your own published content. Previews and sample fixtures do not verify the connection to your dashboard app.

If the FAQ does not appear

  • Wrong app or key: check that the SDK key and published FAQ belong to the same dashboard app.
  • Unpublished content: a draft or archived FAQ is not delivered to your app.
  • Changes seem delayed: FAQs request data on every load, including pull to refresh. Debug mode is not needed for FAQs.
  • Configuration fails: use do/catch around try await Joe.configure to inspect the error. Check network connectivity, the API key, and account API access, then relaunch to retry.

Before you ship

Without appUserID, the SDK uses a locally persisted anonymous identity. For signed-in users, pass a stable, opaque account ID during configuration or call try await Joe.identify(appUserID:) after sign-in. Avoid using an email address or phone number.

Next steps

Continue with the FAQ guide for presentation and support options, or add Feature Plans and Alerts to your app.