بنقرة واحدة
بنقرة واحدة
Stream, video frames, photo capture, resolution/frame rate configuration
Swift patterns, async/await, naming conventions, key types for DAT SDK iOS development
Common issues, Developer Mode, version compatibility, state machine diagnosis
Display capability setup, display-capable device selection, UI DSL, icons, buttons, images, and video playback
SDK setup, Swift Package Manager integration, Info.plist configuration, and first connection to Meta glasses
MockDeviceKit for testing without physical glasses hardware
| name | permissions-registration |
| description | App registration with Meta AI, camera permission flows |
Register your app with Meta AI, then request the device permissions it needs.
The DAT SDK separates two concepts:
All permission grants occur through the Meta AI companion app.
func startRegistration() async throws {
try await Wearables.shared.startRegistration()
}
This opens the Meta AI app where the user approves your app. Meta AI then calls back via your URL scheme.
.onOpenURL { url in
Task {
_ = try? await Wearables.shared.handleUrl(url)
}
}
Task {
for await state in Wearables.shared.registrationStateStream() {
switch state {
case .registered:
// App is registered, can request permissions
case .unavailable:
// Registration is unavailable
case .available:
// Ready to register
case .registering:
// Registration in progress
}
}
}
func startUnregistration() async throws {
try await Wearables.shared.startUnregistration()
}
let status = try await Wearables.shared.checkPermissionStatus(.camera)
let status = try await Wearables.shared.requestPermission(.camera)
The SDK opens Meta AI for the user to grant access. Users can choose:
Users can link multiple glasses to Meta AI. The SDK handles this transparently:
| Mode | Registration behavior |
|---|---|
| Developer Mode | Registration always allowed (use MetaAppID = 0) |
| Production | Users must be in proper release channel |
For production, get your APPLICATION_ID from the Wearables Developer Center.