permissions-registration

App registration with Meta AI and device permission flows

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

More skills from facebook

binary-size-analysis
facebook
Analyze per-commit binary size changes of the hermesvm shared library across a git commit range. Produces a markdown report with per-commit sizes and summary tables of significant increases and decreases.
official
modify-jsi-features
facebook
Guide for adding new JSI functionality to the JavaScript Interface (JSI) layer. Use when the user asks to add, create, or implement new methods or features in…
official
non-interactive-git-rebase
facebook
Use when needing to reorder, split, drop, or amend git commits that are not the top commit, without interactive editor access. Covers programmatic rebase via…
official
click-target
facebook
Find and click a target object in XR. Use when testing UI interactions, clicking buttons, or verifying interactable elements work correctly.
official
iwsdk-planner
facebook
IWSDK project planning and best practices guide. Use when planning new IWSDK features, designing systems/components, reviewing IWSDK code architecture, or when…
official
iwsdk-ui-panel
facebook
Develop and iterate on IWSDK UI panels efficiently. Use when working on PanelUI components, debugging UI layout, or improving UI design in IWSDK applications.
official
test-all
facebook
Parallel test orchestrator. Runs all 9 test suites concurrently via Task sub-agents and the iwsdk CLI. Handles build, example setup, dev servers, agent launch,…
official
test-audio
facebook
Test audio system (AudioSource loading, playback state, stop, spatial audio) against the audio example using the iwsdk CLI.
official