Help us improve
Share bugs, ideas, or general feedback.
How this skill is triggered — by the user, by Claude, or both
Slash command
/mwdat-ios:getting-startedThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Set up the Meta Wearables Device Access Toolkit in an iOS app.
Walks through SDK setup, Gradle integration, AndroidManifest configuration, and first connection to Meta glasses using the Meta Wearables Device Access Toolkit.
Guides building an iOS DAT app with camera streaming and photo capture, covering project setup, SDK initialization, and ViewModel architecture.
Connects a Meta Display Glasses webapp to REST APIs or WebSockets with loading/error states and caching. Use when fetching data, adding real-time updates, or handling offline fallback.
Share bugs, ideas, or general feedback.
Set up the Meta Wearables Device Access Toolkit in an iOS app.
https://github.com/facebook/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>
<!-- Allow the Meta AI companion app to callback -->
<!-- Add fb-viewapp to your app's Info.plist query-schemes allowlist. -->
<!-- External accessory protocol -->
<key>UISupportedExternalAccessoryProtocols</key>
<array>
<string>com.meta.ar.wearable</string>
</array>
<!-- Background modes -->
<key>UIBackgroundModes</key>
<array>
<string>bluetooth-peripheral</string>
<string>external-accessory</string>
</array>
<key>NSBluetoothAlwaysUsageDescription</key>
<string>Needed to connect to Meta Wearables</string>
<!-- DAT configuration -->
<key>MWDAT</key>
<dict>
<key>AppLinkURLScheme</key>
<string>myexampleapp://</string>
<key>MetaAppID</key>
<string>0</string>
</dict>
Replace myexampleapp with your app's URL scheme. Use 0 for MetaAppID during development with Developer Mode, and add fb-viewapp to your app's Info.plist query-schemes allowlist.
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:
.onOpenURL { url in
Task {
_ = try? await Wearables.shared.handleUrl(url)
}
}
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)
try deviceSession.start()
// Wait for the device session to reach the started state
for await state in deviceSession.stateStream() {
if state == .started { break }
}
let config = StreamConfiguration(
videoCodec: .raw,
resolution: .low,
frameRate: 24
)
guard let stream = try deviceSession.addStream(config: config) else {
return
}
// 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
Task { await stream.start() }