<!--
{
  "availability" : [
    "iOS: 27.3.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AccessoryTransportExtension",
  "identifier" : "/documentation/AccessoryTransportExtension/AccessoryTransportSession/makeFeatureSession(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Accessory Transport Extension"
    ],
    "preciseIdentifier" : "s:27AccessoryTransportExtension0aB7SessionC011makeFeatureD0y0D0QzxyXEAC5ErrorOYKAA0af7RuntimeD7HandlerRzlF"
  },
  "title" : "makeFeatureSession(_:)"
}
-->

# makeFeatureSession(_:)

Creates a feature session for the provided handler.

```
func makeFeatureSession<H>(_ handlerFactory: () -> H) throws(AccessoryTransportSession.Error) -> H.Session where H : AccessoryFeatureRuntimeSessionHandler
```

## Parameters

`handlerFactory`

A closure that creates the handler for the new session.

## Discussion

This method requires a Bluetooth transport and throws [`AccessoryTransportSession.Error.unsupported`](/documentation/AccessoryTransportExtension/AccessoryTransportSession/Error/unsupported) otherwise. It throws [`AccessoryTransportSession.Error.invalidated`](/documentation/AccessoryTransportExtension/AccessoryTransportSession/Error/invalidated) if the transport session isn’t valid. It doesn’t fail when the feature isn’t enrolled for the accessory; see [`activate()`](/documentation/AccessoryTransportExtension/AccessoryFeatureRuntimeSession/activate()) for when the session starts. The returned session does nothing until you call [`activate()`](/documentation/AccessoryTransportExtension/AccessoryFeatureRuntimeSession/activate()), and you need to call [`invalidate()`](/documentation/AccessoryTransportExtension/AccessoryFeatureRuntimeSession/invalidate()) before releasing an activated session.

Your transport extension calls this method. A data provider extension can’t create a feature session or wake your transport extension on its own. Call this method in response to an event from your accessory, such as a Bluetooth characteristic update. Only the worker features, [`AccessoryWorker`](/documentation/AccessoryTransportExtension/AccessoryWorker) and [`AccessoryGPUWorker`](/documentation/AccessoryTransportExtension/AccessoryGPUWorker), use feature sessions that you create this way; for more information, see [Accessory features](/documentation/AccessoryTransportExtension/accessory-features).

---

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)