<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MediaSetup",
  "identifier" : "/documentation/MediaSetup/MSSetupSession",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Media Setup"
    ],
    "preciseIdentifier" : "c:objc(cs)MSSetupSession"
  },
  "title" : "MSSetupSession"
}
-->

# MSSetupSession

An object that manages the transfer of configuration information between your app, the system, your media service, and HomePod speakers.

```
class MSSetupSession
```

## Overview

An `MSSetupSession` object guides the user through connecting HomePod speakers in their home to your media service. When your iOS app calls [`start()`](/documentation/MediaSetup/MSSetupSession/start()), the session displays a setup view in the window you provide in [`presentationAnchor()`](/documentation/MediaSetup/MSAuthenticationPresentationContext/presentationAnchor()). The session embeds your app icon and the [`serviceName`](/documentation/MediaSetup/MSServiceAccount/serviceName) you provide into this setup view.

![A wireframe showing the setup view Media Setup displays to the user, with callouts indicating where your app’s icon and your media service’s name appear.](images/com.apple.mediasetup/media-3729379@2x.png)

After the user confirms the setup by tapping the “Use in Home” button, the system requests an OAuth token from your authentication service and shares the token with HomePod speakers in the user’s home.

## Topics

### Preparing the Configuration View

[`init(serviceAccount: MSServiceAccount)`](/documentation/MediaSetup/MSSetupSession/init(serviceAccount:))

Creates a new session.

[`var account: MSServiceAccount`](/documentation/MediaSetup/MSSetupSession/account)

The streaming media service account for the session to configure.

### Presenting the Configuration View

[`var presentationContext: (any MSAuthenticationPresentationContext)?`](/documentation/MediaSetup/MSSetupSession/presentationContext)

A delegate that provides media setup display information to the system.

[`protocol MSAuthenticationPresentationContext`](/documentation/MediaSetup/MSAuthenticationPresentationContext)

A protocol that provides media setup display information to the system.

[`func start() throws`](/documentation/MediaSetup/MSSetupSession/start())

Initiates the service configuration process and sends the account details of the streaming media service to the user’s HomePod speakers.

## Relationships

### Conforms To

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

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

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

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

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

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

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

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)