<!--
{
  "availability" : [
    "visionOS: 26.4.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "FoveatedStreaming",
  "identifier" : "/documentation/FoveatedStreaming/FoveatedStreamingSession",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Foveated Streaming"
    ],
    "preciseIdentifier" : "s:17FoveatedStreaming0aB7SessionC"
  },
  "title" : "FoveatedStreamingSession"
}
-->

# FoveatedStreamingSession

A session that manages a foveated streaming connection to a local or remote streaming endpoint.

```
@MainActor final class FoveatedStreamingSession
```

## Overview

Use `FoveatedStreamingSession` to establish and manage streaming connections from Apple Vision Pro
to local or remote endpoints. The session handles connection life cycle, monitors streaming status, and provides
access to bidirectional message channels for custom data exchange.

You create a `FoveatedStreamingSession` object directly, typically on app initialization.
After creating your session object, use it to initialize the <doc://com.apple.documentation/documentation/SwiftUI/ImmersiveSpace> that displays the streamed content.
To begin streaming spatial content, call the [`connect(endpoint:)`](/documentation/FoveatedStreaming/FoveatedStreamingSession/connect(endpoint:)) function.
The connection will fail if your app doesn’t have the <doc://com.apple.documentation/documentation/BundleResources/Entitlements/com.apple.developer.foveated-streaming-session> entitlement.

The following example shows how to connect to a stream and present its content in an immersive space:

```swift
struct FoveatedStreamingApp: App {
    let session = FoveatedStreamingSession()

    var body: some Scene {
        WindowGroup {
            Button("Connect") {
                Task {
                    try await session.connect(endpoint: .systemDiscovered)
                }
            }
        }

        ImmersiveSpace(foveatedStreaming: session)
    }
}
```

## Topics

### Classes

[`class MessageChannel`](/documentation/FoveatedStreaming/FoveatedStreamingSession/MessageChannel)

A bidirectional channel for sending and receiving custom data.

### Structures

[`struct DisconnectReason`](/documentation/FoveatedStreaming/FoveatedStreamingSession/DisconnectReason)

A description of why a foveated streaming session’s status is in the disconnected state.

[`struct Endpoint`](/documentation/FoveatedStreaming/FoveatedStreamingSession/Endpoint)

A streaming endpoint that a foveated streaming session can connect to.

[`struct ImmersivePresentationBehaviors`](/documentation/FoveatedStreaming/FoveatedStreamingSession/ImmersivePresentationBehaviors-swift.struct)

The presentation behaviors describing when the immersive space that hosts the streamed content is presented and dismissed.

[`struct StreamingProvider`](/documentation/FoveatedStreaming/FoveatedStreamingSession/StreamingProvider)

Represents a streaming provider extension.

### Initializers

[`init()`](/documentation/FoveatedStreaming/FoveatedStreamingSession/init())

Initializes the FoveatedStreamingSession.

### Instance Properties

[`var availableMessageChannels: Set<FoveatedStreamingSession.MessageChannel.ID>`](/documentation/FoveatedStreaming/FoveatedStreamingSession/availableMessageChannels)

A list of all available message channels in this session.

[`var immersivePresentationBehaviors: FoveatedStreamingSession.ImmersivePresentationBehaviors`](/documentation/FoveatedStreaming/FoveatedStreamingSession/immersivePresentationBehaviors-swift.property)

An optional set of behaviors which assist in automatically presenting the session’s immersive space.

[`var immersiveSpaceFromRemoteSceneTransform: simd_float4x4`](/documentation/FoveatedStreaming/FoveatedStreamingSession/immersiveSpaceFromRemoteSceneTransform)

A transform matrix which maps from the streamed scene’s coordinate space origin to the origin of the app’s immersive space.

[`var immersiveSpaceFromRemoteSpaceTransform: simd_float4x4`](/documentation/FoveatedStreaming/FoveatedStreamingSession/immersiveSpaceFromRemoteSpaceTransform)

A transform matrix which maps from the streamed scene’s coordinate space origin to the origin of the app’s immersive space.

[`var requestedInputCapabilities: Set<FoveatedStreamingSession.InputCapability>`](/documentation/FoveatedStreaming/FoveatedStreamingSession/requestedInputCapabilities)

A list of input data types which should be included as part of the stream.

[`var status: FoveatedStreamingSession.Status`](/documentation/FoveatedStreaming/FoveatedStreamingSession/status-swift.property)

The connection status of the session.

### Instance Methods

[`func connect(endpoint: FoveatedStreamingSession.Endpoint) async throws`](/documentation/FoveatedStreaming/FoveatedStreamingSession/connect(endpoint:))

Establishes a streaming connection at the provided endpoint.

[`func connect(endpoint: FoveatedStreamingSession.Endpoint, streamingProvider: FoveatedStreamingSession.StreamingProvider) async throws`](/documentation/FoveatedStreaming/FoveatedStreamingSession/connect(endpoint:streamingProvider:))

Establishes a streaming connection at the provided endpoint using the specified streaming provider.

[`func disconnect() async`](/documentation/FoveatedStreaming/FoveatedStreamingSession/disconnect())

Disconnects from the remote streaming endpoint, ending the streaming session.

[`func messageChannel(for: FoveatedStreamingSession.MessageChannel.ID) -> FoveatedStreamingSession.MessageChannel?`](/documentation/FoveatedStreaming/FoveatedStreamingSession/messageChannel(for:))

Creates or retrieves a message channel for the given message channel ID.

[`func pause() async throws`](/documentation/FoveatedStreaming/FoveatedStreamingSession/pause())

Pauses a session without ending it.

[`func queryAuthorization(for: Set<FoveatedStreamingSession.InputCapability>) async -> [FoveatedStreamingSession.InputCapability : FoveatedStreamingSession.AuthorizationStatus]`](/documentation/FoveatedStreaming/FoveatedStreamingSession/queryAuthorization(for:))

Returns the current authorization status of the given input capabilities without
presenting an authorization prompt.

[`func requestAuthorization(for: Set<FoveatedStreamingSession.InputCapability>?) async -> [FoveatedStreamingSession.InputCapability : FoveatedStreamingSession.AuthorizationStatus]`](/documentation/FoveatedStreaming/FoveatedStreamingSession/requestAuthorization(for:))

Requests authorization for the given input capabilities, prompting the user for
any capability whose status is [`FoveatedStreamingSession.AuthorizationStatus.notDetermined`](/documentation/FoveatedStreaming/FoveatedStreamingSession/AuthorizationStatus/notDetermined).

[`func resume() async throws`](/documentation/FoveatedStreaming/FoveatedStreamingSession/resume())

Resumes a previously paused session.

### Type Methods

[`static func queryStreamingProviders() async -> [FoveatedStreamingSession.StreamingProvider]`](/documentation/FoveatedStreaming/FoveatedStreamingSession/queryStreamingProviders())

Returns a list of currently-available streaming providers.

### Enumerations

[`enum AuthorizationStatus`](/documentation/FoveatedStreaming/FoveatedStreamingSession/AuthorizationStatus)

The authorization status of an [`FoveatedStreamingSession.InputCapability`](/documentation/FoveatedStreaming/FoveatedStreamingSession/InputCapability).

[`enum InputCapability`](/documentation/FoveatedStreaming/FoveatedStreamingSession/InputCapability)

An input source that a streaming session can request to send.

[`enum Status`](/documentation/FoveatedStreaming/FoveatedStreamingSession/Status-swift.enum)

The connection state of a foveated streaming session.

## Relationships

### Conforms To

[`Escapable`](/documentation/Swift/Escapable)

[`Sendable`](/documentation/Swift/Sendable)

[`Observable`](/documentation/Observation/Observable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Copyable`](/documentation/Swift/Copyable)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)