/mwdat-ios:getting-startedfrom mwdat-ios
Walks through DAT SDK setup for iOS: Swift Package Manager integration, Info.plist configuration, and initial connection to Meta glasses.
Ships in mwdat-ios. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Set up the Meta Wearables Device Access Toolkit in an iOS app.
CameraAccess and DisplayAccess sample appshttps://github.com/meta/meta-wearables-dat-iosMWDATCore and MWDATCamera to your targetAdd these required entries to your Info.plist:
<!-- URL scheme for Meta AI callbacks -->
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleURLSchemes</key>
<array>
<string>myexampleapp</string>
</array>
</dict>
</array>
<!-- DAT configuration -->
<key>MWDAT</key>
<dict>
<key>AppLinkURLScheme</key>
<string>myexampleapp://</string>
<key>MetaAppID</key>
<string>$(META_APP_ID)</string>
<key>ClientToken</key>
<string>$(CLIENT_TOKEN)</string>
<key>TeamID</key>
<string>$(DEVELOPMENT_TEAM)</string>
</dict>
<!-- Background modes and Bluetooth LE access -->
<key>UIBackgroundModes</key>
<array>
<string>processing</string>
<string>bluetooth-central</string>
<string>bluetooth-peripheral</string>
</array>
<key>NSBluetoothAlwaysUsageDescription</key>
<string>Needed to connect to Meta AI Glasses</string>
<!-- Local network access for Wi-Fi camera streaming -->
<key>NSLocalNetworkUsageDescription</key>
<string>This lets your phone find and connect to your glasses over Wi-Fi.</string>
<key>NSBonjourServices</key>
<array>
<string>_bonjour._tcp</string>
</array>
Replace myexampleapp with your app's URL scheme and keep MWDAT > AppLinkURLScheme in sync with it — the SDK sends that scheme to Meta AI so it can call your app back.
MetaAppID, ClientToken, and TeamID come from build settings in the sample apps. With Developer Mode you can leave MetaAppID empty, set it to 0, or leave the $(META_APP_ID) placeholder unexpanded; the SDK treats all three as "no app ID" and skips attestation. For production, set MetaAppID and ClientToken from your app in the Wearables Developer Center and set TeamID to your Apple Developer Team ID (Xcode > Signing & Capabilities).
The SDK uses a connection only when Info.plist has that connection's entries:
| Connection | Required Info.plist entries | Used for |
|---|---|---|
| Bluetooth LE | bluetooth-central background mode, non-empty NSBluetoothAlwaysUsageDescription | Session setup and control, and Display content |
| Wi-Fi | non-empty NSLocalNetworkUsageDescription, _bonjour._tcp in NSBonjourServices | Camera streaming, including capturePhoto(format:) |
With these entries, the camera stream runs over Wi-Fi and never over Bluetooth LE. Without the Wi-Fi entries, it fails with StreamError.deviceNotConnected. The SDK applies the same checks to MockDeviceKit devices.
To stream over Wi-Fi, the phone joins a Wi-Fi network that the glasses host, so the app target also needs the Hotspot Configuration capability (com.apple.developer.networking.HotspotConfiguration). Add it under Signing & Capabilities in Xcode, which sets it to true in the target's .entitlements file, as in CameraAccess. If the user denies Local Network access or declines to join the glasses' network, the camera stream fails with StreamError.deviceNotConnected and the session continues over Bluetooth LE.
Match CameraAccess by also enabling Access Wi-Fi Information (com.apple.developer.networking.wifi-info) in the app's entitlements.
Use Bluetooth LE + Wi-Fi by default. When migrating an existing app, remove external-accessory from UIBackgroundModes and remove com.meta.ar.wearable from UISupportedExternalAccessoryProtocols (remove the key if no protocols remain). Those entries enable the optional Bluetooth Classic path, not Bluetooth LE or Wi-Fi, and can cause App Review to request an MFi PPID that Meta cannot provide. Keep them only if you intentionally use Bluetooth Classic and can satisfy that requirement.
Only add the audio background mode and NSMicrophoneUsageDescription if you record glasses-microphone audio, as CameraAccess does.
Call Wearables.configure() once at app launch:
import MWDATCore
@main
struct MyApp: App {
init() {
do {
try Wearables.configure()
} catch {
assertionFailure("Failed to configure Wearables SDK: \(error)")
}
}
var body: some Scene {
WindowGroup {
ContentView()
}
}
}
Your app must handle the URL callback from Meta AI after registration and permission flows. Both sample apps filter on the metaWearablesAction query item so unrelated deep links are not forwarded to the SDK:
.onOpenURL { url in
guard
let components = URLComponents(url: url, resolvingAgainstBaseURL: false),
components.queryItems?.contains(where: { $0.name == "metaWearablesAction" }) == true
else {
return
}
Task {
do {
_ = try await Wearables.shared.handleUrl(url)
} catch {
// Surface the failure; `handleUrl` throws `WearablesHandleURLError`
}
}
}
func startRegistration() async throws {
try await Wearables.shared.startRegistration()
}
Observe registration state:
Task {
for await state in Wearables.shared.registrationStateStream() {
// Update UI based on registration state
}
}
import MWDATCore
import MWDATCamera
// Create a DeviceSession — device selection is configured here
let wearables = Wearables.shared
let deviceSelector = AutoDeviceSelector(wearables: wearables)
let deviceSession = try wearables.createSession(deviceSelector: deviceSelector)
let states = deviceSession.stateStream()
try deviceSession.start()
// Wait for the device session to reach the started state
for await state in states {
if state == .started { break }
}
// Check camera permission before adding the camera
if try await wearables.checkPermissionStatus(.camera) != .granted {
// Confirm with the user, then:
guard try await wearables.requestPermission(.camera) == .granted else { return }
}
let config = StreamConfiguration(
videoCodec: .raw,
resolution: .low,
frameRate: 24
)
guard let camera = try deviceSession.addCamera(config: config) else {
return
}
let stream = camera.stream
// Observe frames
let frameToken = stream.videoFramePublisher.listen { frame in
guard let image = frame.makeUIImage() else { return }
Task { @MainActor in
self.currentFrame = image
}
}
// Start the stream capability
stream.start()
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub meta/meta-wearables-dat-ios --plugin mwdat-ios18 skills in this plugin
/audio-streamingReceive synchronized PCM audio frames through a Camera stream on iOS/camera-captureCapture standalone high-quality photos from connected glasses on iOS/camera-streamingStream, video frames, photo capture, resolution/frame rate configuration/dat-conventionsSwift patterns, async/await, naming conventions, key types for DAT SDK iOS development/dat-docs-mcpUse the Wearables DAT MCP server for live DAT documentation search with `search_dat_docs`, Muse Code, Claude Code, Codex, Cursor, and MCP Inspector/debuggingCommon issues, Developer Mode, version compatibility, state machine diagnosisOther plugins' skills for the same job