audio-streaming
Receive synchronized PCM audio frames through a Camera stream on iOS
Display capability setup, display-capable device selection, UI DSL, icons, buttons, images, and video playback
$ npx -y skills add facebook/meta-wearables-dat-ios --skill display-access --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/display-accessContext preview
The summary Claude sees to decide when to auto-load this skill.
Display capability setup, display-capable device selection, UI DSL, icons, buttons, images, and video playback
name: display-access description: Display capability setup, display-capable device selection, UI DSL, icons, buttons, images, and video playback
Use `MWDATDisplay` to render content on Meta Ray-Ban Display glasses.
Use this skill with `getting-started` and `permissions-registration` when creating a full app. A Display app still needs `Wearables.configure()` at launch, Info.plist URL scheme configuration, URL callbacks through `Wearables.shared.handleUrl(_:)`, and completed Meta AI registration before it can create a session.
Add `MWDATDisplay` to the same app target that already uses `MWDATCore`. Import it next to core:
import MWDATCore import MWDATDisplay
For a phone preview, add `MWDATMockDevice` alongside `MWDATDisplay`, enable `MockDeviceKit`, and pair a display-capable model:
import MWDATMockDevice MockDeviceKit.shared.enable() let mockDevice = try MockDeviceKit.shared.pairGlasses(model: .metaRayBanDisplay) mockDevice.powerOn() mockDevice.don() // Render what the glasses would show, inside your app let previewView = mockDevice.services.display.createPreviewView()
`MockDisplayKit` also exposes `sendClick(identifier:)` so tests can simulate taps.
Use the normal `DeviceSession.addDisplay()` API for both physical and mock devices. Wait until `deviceForIdentifier(_:)` reports `linkState == .connected` and `compatibility() == .compatible` before creating the session.
Use the getting-started Info.plist setup, then mirror the DisplayAccess sample for Display sessions:
Use the public display filter when creating an automatic selector:
let wearables = Wearables.shared
let deviceSelector = AutoDeviceSelector(
wearables: wearables,
filter: { device in device.supportsDisplay() }
)Use `SpecificDeviceSelector(device: selectedDevice.identifier)` instead when your UI lets the user pick a specific `Device`. The initializer takes a `DeviceIdentifier`, not the whole `Device`.
`AutoDeviceSelector` updates from `devicesStream()`. Create it before the user taps the Display action, or wait for `activeDeviceStream()` to yield a non-nil device before calling `createSession(deviceSelector:)`; otherwise `createSession` can throw `DeviceSessionError.noEligibleDevice`.
For a picker or Settings screen, list devices from `Wearables.shared.devicesStream()`, then look up metadata from `deviceForIdentifier(_:)`. The DisplayAccess sample shows `nameOrId()`, `deviceType().rawValue`, `linkState`, and `compatibility()` and keeps `addLinkStateListener` / `addCompatibilityListener` tokens alive while rows are visible. If `compatibility() == .deviceUpdateRequired`, surface a firmware update action through `Wearables.shared.openFirmwareUpdate()`.
Create and start the `DeviceSession`, wait for `.started`, then add and start `Display`. Keep the state listener token alive for as long as you need updates, and observe `session.errorStream()` for async session failures.
import MWDATCore
import MWDATDisplay
@MainActor
final class DisplayController {
private var deviceSession: DeviceSession?
private var display: Display?
private var displayStateToken: AnyListenerToken?
private var sessionErrorTask: Task<Void, Never>?
func connect() async {
do {
let wearables = Wearables.shared
let selector = AutoDeviceSelector(
wearables: wearables,
filter: { $0.supportsDisplay() }
)
let session = try wearables.createSession(deviceSelector: selector)
deviceSession = session
sessionErrorTask = Task { [weak self] in
for await error in session.errorStream() {
await self?.showError(error.localizedDescription)
}
}
let sessionStarted = Task {
for await state in session.stateStream() {
if state == .started {
return
}
}
}
do {
try session.start()
await sessionStarted.value
} catch {
sessionStarted.cancel()
throw error
}
let capability = try session.addDisplay()
display = capability
displayStateToken = capability.statePublisher.listen { [weak self] state in
Task { @MainActor in
if state == .started {
self?.showStatusCard()
}
}
}
capability.start()
} catch DeviceSessionError.datAppOnTheGlassesUpdateRequired {
showDATGlassesAppUpdate()
} catch {
showError(error.localizedDescription)
}
}
func disconnect() async {
display?.onPlaybackEvent = nil
display?.stop()
deviceSession?.stop()
sessionErrorTask?.cancel()
sessionErrorTask = nil
displayStateToken = nil
display = nil
deviceSession = nil
}
}F
The Meta Wearables Device Access Toolkit enables developers to utilize Meta's AI glasses to build hands-free wearable experiences into their mobile applications.
Receive synchronized PCM audio frames through a Camera stream on iOS
Capture standalone high-quality photos from connected glasses on iOS
Stream, video frames, photo capture, resolution/frame rate configuration
Swift patterns, async/await, naming conventions, key types for DAT SDK iOS development
Use the Wearables DAT MCP server for live DAT documentation search with `search_dat_docs`,…