From mwdat-ios
Manages device session states (idle, started, paused, stopped) for DAT SDK integrations on Meta glasses. Handles pause/resume, stream state transitions, and device availability monitoring.
How this skill is triggered — by the user, by Claude, or both
Slash command
/mwdat-ios:session-lifecycleThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Guide for managing device session states in DAT SDK integrations.
Guide for managing device session states in DAT SDK integrations.
The DAT SDK runs work inside sessions. Meta glasses expose two experience types:
Your app observes session state changes — the device decides when to transition.
| State | Meaning | App action |
|---|---|---|
idle | Session created but not started | Call start() when ready |
starting | Session is connecting to the device | Show connecting state |
started | Session active and ready for capabilities | Add or resume work |
paused | Temporarily suspended by the device | Hold work, may resume |
stopping | Session is cleaning up | Wait for terminal state |
stopped | Session inactive and terminal | Free resources, create a new session to restart |
let session = try Wearables.shared.createSession(deviceSelector: AutoDeviceSelector(wearables: Wearables.shared))
try session.start()
Task {
for await state in session.stateStream() {
switch state {
case .started:
// Confirm UI shows session is live
case .paused:
// Keep connection, wait for started or stopped
case .stopped:
// Release resources, allow user to restart
default:
break
}
}
}
A Stream is a capability attached to a started DeviceSession:
stopped → waitingForDevice → starting → streaming → paused → stopped
guard let stream = try session.addStream(config: StreamConfiguration()) else { return }
let token = stream.statePublisher.listen { state in
Task { @MainActor in
// React to state changes
}
}
The device changes session state when:
When a session is paused:
startedYour app should not attempt to restart while paused — wait for started or stopped.
Monitor device availability to know when sessions can start:
Task {
for await devices in Wearables.shared.devicesStream() {
// Update list of available glasses
}
}
Key behaviors:
stoppedstarted, paused, stopped)stoppedpaused — wait for system to resume or stopnpx claudepluginhub facebook/meta-wearables-dat-ios --plugin mwdat-iosManages session and stream state for Meta Wearables DAT SDK on Android, including pause/resume, device availability monitoring, and state transitions.
Diagnoses iOS DAT SDK integration issues: Developer Mode, stream states, version compatibility, and registration failures for Meta smart glasses.
Add IMU and GPS sensor data to Meta Display Glasses webapps via Web APIs. For motion tracking, compass, level tool, step counter, shake detection, head tracking, or location.