permissions-registration

โดย facebook

การลงทะเบียนแอปกับ Meta AI, ขั้นตอนการขอสิทธิ์กล้อง

npx skills add https://github.com/facebook/meta-wearables-dat-ios --skill permissions-registration

Permissions & Registration (iOS)

Register your app with Meta AI, then request the device permissions it needs.

The DAT SDK separates two concepts:

  1. Registration — Your app registers with Meta AI to become a permitted integration
  2. Device permissions — After registration, request specific device permissions (e.g., camera)

All permission grants occur through the Meta AI companion app.

Registration flow

Start registration

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.

Handle the callback

.onOpenURL { url in
    Task {
        _ = try? await Wearables.shared.handleUrl(url)
    }
}

Observe registration state

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
        }
    }
}

Unregister

func startUnregistration() async throws {
    try await Wearables.shared.startUnregistration()
}

Camera permissions

Check permission status

let status = try await Wearables.shared.checkPermissionStatus(.camera)

Request permission

let status = try await Wearables.shared.requestPermission(.camera)

The SDK opens Meta AI for the user to grant access. Users can choose:

  • Allow once — temporary, single-session grant
  • Allow always — persistent grant

Multi-device behavior

Users can link multiple glasses to Meta AI. The SDK handles this transparently:

  • Permission granted on any linked device means your app has access
  • You don't need to track which device has permissions
  • If all devices disconnect, permissions become unavailable

Developer Mode vs Production

ModeRegistration behavior
Developer ModeRegistration always allowed (use MetaAppID = 0)
ProductionUsers must be in proper release channel

For production, get your APPLICATION_ID from the Wearables Developer Center.

Prerequisites

  • Registration requires an internet connection
  • Meta AI companion app must be installed
  • For Developer Mode: enable in Meta AI > Settings > Your glasses > Developer Mode

Links

Skills เพิ่มเติมจาก facebook

api-health
facebook
Monitor API health for a Meta app — check rate limits, call volume, and API deprecations. Use to diagnose throttling, plan capacity, or prepare for API version…
official
api-integration
facebook
แนะนำนักพัฒนาในการตั้งค่าการเชื่อมต่อ Meta API ตั้งแต่เริ่มต้น — ค้นหา API ที่เหมาะสม ดึงคู่มือการตั้งค่า ข้อกำหนดการยืนยันตัวตน…
official
app-review-prep
facebook
เตรียมแอป Meta สำหรับ App Review — ตรวจสอบสถานะปัจจุบัน ข้อกำหนดที่ค้างอยู่ สิทธิ์ที่ได้รับ และประวัติการส่ง ใช้ก่อนส่งแอป…
official
debug-webhooks
facebook
แก้ไขปัญหาเว็บฮุคสำหรับแอป Meta — ตรวจสอบการสมัครใช้งานที่ใช้งานอยู่ ระบุการตั้งค่าที่ผิดพลาด และส่งเพย์โหลดทดสอบเพื่อยืนยันการส่งมอบ ใช้เมื่อ…
official
webhook-setup
facebook
Set up webhooks for a Meta app end-to-end — discover available topics, subscribe to fields, and verify with a test payload. Use when configuring webhooks for…
official
buck2-rule-basics
facebook
แนะนำผู้ใช้ผ่านการเขียนกฎ Buck2 ตัวแรก เพื่อเรียนรู้แนวคิดพื้นฐาน ได้แก่ กฎ แอ็กชัน เป้าหมาย คอนฟิกูเรชัน การวิเคราะห์ และ select() ใช้…
official
add-ir-instruction
facebook
คู่มือสำหรับการเพิ่ม IR instruction ใหม่ให้กับ Hermes compiler ใช้เมื่อผู้ใช้ขอให้เพิ่ม สร้าง หรือกำหนด IR instruction ใหม่ (Inst/Instruction) ใน...
official
binary-size-analysis
facebook
ทักษะนี้ควรใช้เมื่อผู้ใช้ต้องการวิเคราะห์การเปลี่ยนแปลงขนาดไบนารีของ hermesvm ในช่วงของคอมมิต ใช้เมื่อผู้ใช้กล่าวถึง "binary size",…
official