Skip to content
Mobile Joe Docs Dashboard
View Markdown

iOS · SwiftUI · SDK 1.0.1

Alerts

Display in-app warning and error banners for service problems or other issues affecting your users.

Complete the iOS quickstart first. These examples use your configured app and MobileJoeUI.

Deliver an alert

In the dashboard, open Alerts, create a Warning or Error alert, set its Targeting (or Send to all users), and choose Deliver → Deliver now. Targeting matches exact app and OS versions; see Content delivery. Archive the alert when the issue is resolved.

Place the banners

Add AlertsView() where users should see alerts. This example places them above the screen's list:

import SwiftUI
import MobileJoeUI

struct HomeView: View {
  var body: some View {
    NavigationStack {
      List {
        Text("Your app content")
      }
      .navigationTitle("Home")
      .safeAreaInset(edge: .top, spacing: 0) {
        AlertsView()
          .padding(.horizontal)
      }
    }
  }
}

The view shows one banner per alert, colored by kind. Tapping a banner opens its details; closing them leaves the banner visible, as alerts cannot be dismissed permanently.

Refresh and testing

AlertsView loads on appearance and when the app becomes active, at most once every 15 minutes. Add debugMode: true to Joe.configure during integration to skip the interval and receive alerts with Debug delivery; see Debug mode.

Use your own UI

Import MobileJoe and keep an observable Alerts() model in @State. Call try await alerts.load() on the main actor and read alerts.all; the same interval applies. Handle errors yourself: the standard view hides them.

Pass a model to AlertsView(alerts:), render individual banners with AlertView(alert:), or build your own interface from each alert's title, message, kind, and occurredAt.

Verify

Run the app, confirm your delivered alert appears, and open its details. Archive it, then trigger an eligible refresh and confirm it disappears. If it is missing, follow Troubleshooting.