# permissions-registration

App registration with Meta AI and device permission flows

Skill by Meta. Category: Security.

## Install

Project (for this project only):

```sh
npx skills add facebook/meta-wearables-dat-android --skill permissions-registration
```

Works with: Claude Code, Codex CLI, Cursor, Antigravity, Copilot CLI, opencode.

Global (for every project on this machine):

```sh
npx skills add facebook/meta-wearables-dat-android --skill permissions-registration -g
```

Works with: Claude Code, Codex CLI, Cursor, Antigravity, Copilot CLI, opencode.

## Tags

- Runs on your computer: It runs as a program on your machine, with your access.

## Security audits

- Gen Agent Trust Hub: Pass
- Socket: Pass
- Snyk: Pass

Installs: 9. Installs counted by skills.sh. [Open on skills.sh](https://www.skills.sh/facebook/meta-wearables-dat-android/permissions-registration)

## Source

[Open the source](https://github.com/facebook/meta-wearables-dat-android/tree/HEAD/plugins/mwdat-android/skills/permissions-registration). Checked 2026-10-10. This summary may contain AI-generated text, so it can be wrong. Check the source before you rely on it.

## SKILL.md

````markdown
---
name: permissions-registration
description: App registration with Meta AI and device permission flows
---

# 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

```kotlin
Wearables.startRegistration(activity)
```

Observe registration state:

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

To unregister:

```kotlin
Wearables.startUnregistration(activity)
```

## Check permission status

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

```kotlin
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:

```kotlin
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

| Mode | Registration behavior |
|------|------------------------|
| Developer Mode | Use `mwdat_application_id = 0` and `mwdat_client_token = 0` manifest placeholders for local development |
| Production | Use 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

- [Permissions documentation](https://wearables.developer.meta.com/docs/permissions-requests)
- [Manage projects](https://wearables.developer.meta.com/docs/manage-projects)
- [Android integration guide](https://wearables.developer.meta.com/docs/build-integration-android)
````

- Previous: [getting-started](https://syn4pse.dev/terminal/meta-android-getting-started.md)
- Next: [sample-app-guide](https://syn4pse.dev/terminal/meta-android-sample-app-guide.md)
- [Terminal](https://syn4pse.dev/terminal.md)
- [Suggest a change](mailto:terminal@syn4pse.dev?subject=Terminal%20suggestion)
