permissions-registration

โดย facebook

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

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

Permissions & Registration (Android)

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

The DAT SDK separates two steps:

  1. Registration: The user connects your app to Meta AI.
  2. Device permissions: After registration, your app requests capabilities such as camera access.

Both flows depend on the Meta AI app being installed on the phone.

Start registration

Wearables.startRegistration(activity)

Observe registration state:

lifecycleScope.launch {
    Wearables.registrationState.collect { state ->
        // Update your registration UI
    }
}

To unregister:

Wearables.startUnregistration(activity)

Check permission status

checkPermissionStatus(...) is a suspend API that returns a DatResult.

lifecycleScope.launch {
    Wearables.checkPermissionStatus(Permission.CAMERA)
        .onSuccess { status ->
            if (status == PermissionStatus.Granted) {
                startStreaming()
            }
        }
        .onFailure { error, _ ->
            showPermissionError(error.description)
        }
}

Request a permission

Use Wearables.RequestPermissionContract() with the Activity Result API:

private val permissionLauncher =
    registerForActivityResult(Wearables.RequestPermissionContract()) { result ->
        result.onSuccess { status ->
            if (status == PermissionStatus.Granted) {
                startStreaming()
            }
        }.onFailure { error, _ ->
            showPermissionError(error.description)
        }
    }

fun requestCameraPermission() {
    permissionLauncher.launch(Permission.CAMERA)
}

Users can allow once or allow always through the Meta AI flow.

Developer Mode vs production

ModeRegistration behavior
Developer ModeUse mwdat_application_id = 0 and mwdat_client_token = 0 manifest placeholders for local development
ProductionUse the application ID and client token assigned in the Wearables Developer Center

For development builds, enable Developer Mode in the Meta AI app before testing registration and permissions.

Prerequisites

  • Internet connection for registration
  • Meta AI app installed on the phone
  • Callback URI scheme configured in AndroidManifest.xml
  • Bluetooth permission granted on Android

Links

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

binary-size-analysis
facebook
วิเคราะห์การเปลี่ยนแปลงขนาดไบนารีต่อคอมมิตของ shared library hermesvm ในช่วงของ git commit สร้างรายงาน markdown พร้อมขนาดต่อคอมมิตและตารางสรุปการเพิ่มขึ้นและลดลงที่สำคัญ
official
modify-jsi-features
facebook
คู่มือสำหรับการเพิ่มฟังก์ชันการทำงาน JSI ใหม่ให้กับเลเยอร์ JavaScript Interface (JSI) ใช้เมื่อผู้ใช้ขอให้เพิ่ม สร้าง หรือนำเมธอดหรือฟีเจอร์ใหม่ไปใช้ใน…
official
non-interactive-git-rebase
facebook
ใช้เมื่อต้องการจัดลำดับใหม่ แยก ลบ หรือแก้ไข git commits ที่ไม่ใช่ commit ล่าสุด โดยไม่ต้องเข้าถึงตัวแก้ไขแบบโต้ตอบ ครอบคลุมการ rebase ผ่านโปรแกรม…
official
click-target
facebook
ค้นหาและคลิกวัตถุเป้าหมายใน XR ใช้เมื่อทดสอบการโต้ตอบ UI การคลิกปุ่ม หรือตรวจสอบว่าองค์ประกอบที่สามารถโต้ตอบได้ทำงานอย่างถูกต้อง
official
iwsdk-planner
facebook
คู่มือการวางแผนโครงการ IWSDK และแนวทางปฏิบัติที่ดีที่สุด ใช้เมื่อวางแผนฟีเจอร์ IWSDK ใหม่ ออกแบบระบบ/ส่วนประกอบ ทบทวนสถาปัตยกรรมโค้ด IWSDK หรือเมื่อ...
official
iwsdk-ui-panel
facebook
พัฒนาและปรับปรุงแผง UI ของ IWSDK อย่างมีประสิทธิภาพ ใช้เมื่อทำงานกับคอมโพเนนต์ PanelUI แก้ไขปัญหาเค้าโครง UI หรือปรับปรุงการออกแบบ UI ในแอปพลิเคชัน IWSDK
official
test-all
facebook
ตัวประสานการทดสอบแบบขนาน รันชุดทดสอบทั้งหมด 9 ชุดพร้อมกันผ่าน Task sub-agents และ iwsdk CLI จัดการการสร้าง การตั้งค่าตัวอย่าง เซิร์ฟเวอร์สำหรับพัฒนา การเปิดตัวเอเจนต์…
official
test-audio
facebook
ทดสอบระบบเสียง (การโหลด AudioSource, สถานะการเล่น, การหยุด, เสียงเชิงพื้นที่) กับตัวอย่างเสียงโดยใช้ iwsdk CLI
official