App registration with Meta AI, camera permission flows
复制安装指令,让 AI 自动完成配置 · 推荐新手
请帮我安装 askskill 上的 "permissions-registration" 技能: 1. 下载 https://raw.githubusercontent.com/facebook/meta-wearables-dat-ios/main/plugins/mwdat-ios/skills/permissions-registration/SKILL.md 2. 保存为 ~/.claude/skills/permissions-registration/SKILL.md 3. 装好后重载技能,告诉我可以用了
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.
Stream, video frames, photo capture, resolution/frame rate configuration
Device session states, pause/resume, availability monitoring
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