Skip to main content
A minimal integration that loads a web-based identity journey inside a native iOS app. This example compiles and runs as a standalone SwiftUI app.

What This Example Demonstrates

  • Initializing a BridgeHost with typed capability slots
  • Declaring document capture support via handler assignment
  • Displaying a journey using BridgeWebView
  • Observing bridge errors

Complete Source

How It Works

  1. BridgeHost(hostVersion:) creates a host with typed capability slots. No separate configuration dictionary is needed.
  2. Setting a handler on documentCapture declares the capability as supported. The handler uses awaitCompletion() to suspend until the UI layer calls complete().
  3. CameraDetector.check() detects camera hardware and permission state. The permissionState is included in capability query responses.
  4. BridgeWebView creates a WKWebView, injects the bootstrap script, registers the message handler, attaches the WebView to the host, and loads the journey URL.
  5. Error observation — host.lastError is @Published, so the error banner appears and disappears reactively.

What Happens at Runtime

Required Info.plist Entries

For this minimal example, no special Info.plist entries are needed beyond the defaults. If your journey URL uses HTTP during development, add:

Next Steps