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:
- Create once. Call
Extentos.create(config:)(orExtentos.default()) at app start and hold theExtentosGlassesfor the app's lifetime — typically aleton your SwiftUIAppor a long-lived view model. See Initialization. - Forward the auth callback. Route the Meta DAT custom-scheme callback through
.onOpenURL→glasses.handleUrl(_:)so pairing can complete. - Open the connection. Use the
connectionsub-client (or the prebuiltExtentosConnectionPagefromGlassesUI) to connect to the glasses, and observe its connection-state stream. - Tear down. Call
await glasses.shutdown()when you're done. It'sasync—awaitit 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.
Related
Initialization (iOS)
Initialize the Extentos iOS SDK with Extentos.create(config:), forward the Meta DAT auth callback via .onOpenURL and handleUrl, request speech authorization, and reach the typed sub-clients.
Threading model (iOS)
How the Extentos iOS SDK concurrency works — ExtentosGlasses is Sendable, every sub-client call is async, MainActor guidance for UI, and why the package builds in Swift 5 language mode.
Runtime internals (iOS)
How the Extentos iOS Swift shell wraps the shared Rust core via uniffi, where the DAT-iOS transport bridge sits, and what's platform-bound vs shared.
Initialization (iOS)
Initialize the Extentos iOS SDK with Extentos.create(config:), forward the Meta DAT auth callback via .onOpenURL and handleUrl, request speech authorization, and reach the typed sub-clients.
Threading model (iOS)
How the Extentos iOS SDK concurrency works — ExtentosGlasses is Sendable, every sub-client call is async, MainActor guidance for UI, and why the package builds in Swift 5 language mode.