SDKiOS

Lifecycle (iOS)

The Extentos iOS SDK lifecycle — create one instance for the app's lifetime, forward the auth callback, and tear down with the async shutdown().

The lifecycle shape below is verified against the current iOS source. Package install: Install.

The shape

The Extentos iOS instance has a simple lifecycle, owned by your app — there's no separate framework lifecycle to register with:

  1. Create once. Call Extentos.create(config:) (or Extentos.default()) at app start and hold the ExtentosGlasses for the app's lifetime — typically a let on your SwiftUI App or a long-lived view model. See Initialization.
  2. Forward the auth callback. Route the Meta DAT custom-scheme callback through .onOpenURLglasses.handleUrl(_:) so pairing can complete.
  3. Open the connection. Use the connection sub-client (or the prebuilt ExtentosConnectionPage from GlassesUI) to connect to the glasses, and observe its connection-state stream.
  4. Tear down. Call await glasses.shutdown() when you're done. It's asyncawait it so cleanup completes before you release the instance.
func tearDown() async {
    await glasses.shutdown()
}

Backgrounding

A live glasses session — an open accessory channel and routed audio — must survive the app moving to the background. That's why the Info.plist declares UIBackgroundModes: without it iOS would suspend the app and drop the connection the moment the user looks away from the phone. You don't manually pause and resume the SDK around backgrounding; keep the instance alive and let the connection-state stream report any drop.

There are no additional app-state hooks to wire — keep the instance alive across scene phases and observe the connection-state stream. For the behavioral model that both platforms share, see transport vs app simulation; the Android counterpart is Android lifecycle.