---
title: Lifecycle (iOS)
description: The Extentos iOS SDK lifecycle — create one instance for the app's lifetime, forward the auth callback, and tear down with the async shutdown().
type: guide
platform: ios
related:
  - /docs/sdk/ios/initialization
  - /docs/sdk/ios/threading
  - /docs/sdk/ios/runtime-internals
---

> The lifecycle shape below is verified against the current iOS source. Package install: [Install](/docs/sdk/ios/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](/docs/sdk/ios/initialization).
2. **Forward the auth callback.** Route the Meta DAT custom-scheme callback through `.onOpenURL` → `glasses.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 `async` — `await` it so cleanup completes before you release the instance.

```swift
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`](/docs/sdk/ios/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](/docs/concepts/transport-vs-app); the Android counterpart is [Android lifecycle](/docs/sdk/android/lifecycle).
