audioaccessorykit
Support audio accessory features like automatic switching using AudioAccessoryKit. Use when implementing automatic audio routing for paired accessories, registering audio accessory configuration from the container app, updating placement or connected audio source identifiers from an app extension, or handling AccessoryControlDevice capabilities and errors.
Security Assessment
About audioaccessorykit
Support for third-party audio accessory features - notably automatic audio switching and intelligent routing inputs - using Apple's AudioAccessoryKit, available on iOS and iPadOS 26.4+. The framework builds on AccessorySetupKit: an accessory must first be paired over Bluetooth (yielding an ASAccessory) before it can be registered for audio features. Its central type, AccessoryControlDevice, lets the container app register a Configuration describing the accessory's capabilities and initial state, and lets an app extension apply ongoing configuration updates that help the system decide where to route audio. Registration is performed with AccessoryControlDevice.register(accessory, configuration); the app extension retrieves the current device with the app-extension-only current(for:) and pushes changes with the async, throwing update(_:). Capabilities are an option set with two members - .audioSwitching (the device supports automatic switching) and .placement (the device can report its physical position) - which may be combined, though .placement should only be declared when the accessory can keep the system updated with real placement state. Placement is reported through four cases: .inEar, .onHead, .overTheEar, and .offHead, updated promptly on every detected change for responsive routing. For accessories connected to multiple Bluetooth devices at once, the primary and secondary audio-source device identifiers are supplied as Data holding Bluetooth addresses and updated as connection state changes. The Configuration exposes deviceCapabilities, devicePlacement, and the primary and secondary source identifiers, and feature discovery reads deviceCapabilities.contains(...) to check what a paired device supports. Because the framework is new in 26.4 and beta-sensitive, the guidance advises re-checking current Apple documentation before relying on specific API details.
FAQ
What must happen before registering an accessory for audio features?
The accessory must first be paired over Bluetooth using AccessorySetupKit, which yields the ASAccessory object you then register with AudioAccessoryKit.
What platforms and versions are required?
AudioAccessoryKit is available on iOS 26.4+ and iPadOS 26.4+, and because it is new and beta-sensitive, current Apple documentation should be re-checked before relying on specific API details.
Which capabilities can a device declare?
The Capabilities option set has two members: .audioSwitching for automatic audio switching and .placement for reporting physical position. They can be combined, but declare .placement only when the accessory can report real placement.
What placement values are available?
Four cases: .inEar, .onHead, .overTheEar, and .offHead. Update placement promptly on every detected change so audio routing stays responsive.
How does the app extension read and change configuration?
It gets the device with AccessoryControlDevice.current(for:), reads its configuration, and pushes changes with the async update(_:) call. Both current(for:) and update(_:) are app-extension-only.
Install audioaccessorykit
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
dpearson2699/swift-ios-skills