# DAT SDK v0.6 ## Section 1: Guides ### Setup ## Overview The Wearables Device Access Toolkit supports iOS and Android mobile platforms, with the same OS version requirements as the Meta AI app (iOS 15.2+ and Android 10+). Xcode 14.0+ is supported for iOS. Android Studio Flamingo or newer is supported for Android. ## Hardware requirements Currently, the SDK supports the Ray-Ban Meta (Gen 1 and Gen 2), Ray-Ban Meta Optics, and Meta Ray-Ban Display glasses. You can test with a simulated device using [Mock Device Kit](/docs/mock-device-kit), or directly with a device. Detailed version support of the Meta AI app and glasses firmware is located in the [Version Dependencies](/docs/version-dependencies) page. ## Setting up your glasses To set up your glasses for development: 1. Ensure your Meta AI app version is v254+. 2. Ensure your glasses software is version v20+ for Ray-Ban Meta glasses or v21+ for Meta Ray-Ban Display glasses. Follow the instructions below to verify your current version. 3. Connect your glasses to the Meta AI app. 4. Enable developer mode (instructions below). ### Verify glasses software version 1. In the Meta AI app, go to the Devices tab (the glasses icon at the bottom of the app), and select your device. 2. Tap the gear icon to open **Device settings**. 3. Tap **General** > **About** > **Version**. 4. You should have the minimum supported version or above installed on your glasses, as outlined [here](/docs/version-dependencies). 5. If your version is below minimum support requirements, update your glasses software. ### Enable developer mode in the Meta AI app 1. On your iOS or Android device, select **Settings** > **App Info**, and then tap the **App version** number five times to display the toggle for developer mode. 2. Select the toggle to enable **Developer Mode**. 3. Click **Enable** to confirm. **iOS** ![Image of enabling developer mode on an iOS device](/images/wearables-devmode-ios.png){: width="296"} **Android** ![Image of enabling developer mode on an android device](/images/wearables-devmode-android.png){: width="296"} ### Integration overview ## Overview The Wearables Device Access Toolkit lets your mobile app integrate with supported AI glasses. An integration establishes a session with the device so your app can access supported sensors on the user’s glasses. Users start a session from your app, and then interact through their glasses. They can: * Speak to your app through the device's microphones * Send video or photos from the device's camera * Pause, resume, or stop the session by tapping the glasses, taking them off, or closing the hinges * Play audio to the user through the device’s speakers ## Supported devices Detailed support to devices and version of the Meta AI app and glasses firmware are located in the [Version Dependencies](/docs/version-dependencies) page. ## Integration lifecycle 1. **Registration**: The user connects your app to their wearable device by tapping a call-to-action in your app. This is a one‑time flow. After registration, your app can identify and connect to the user’s device when your app is open. The flow deeplinks the user to the Meta AI app for confirmation, then returns them to your app. 2. **Permissions**: The first time your app attempts to access the user's camera, you must request permission. The user can allow always, allow once, or deny. Your app deeplinks the user to the Meta AI app to confirm the requested permission, and then Meta AI returns them to your app. Microphone access uses the Hands‑Free Profile (HFP), so you request those permissions through iOS or Android platform dialogs. 3. **Session**: After registration and permissions, the user can start a session. During a session, the user engages with your app on their device. ## Sessions All integrations with Meta AI glasses run as sessions. Only one session can run on a device at a time, and certain features are unavailable while your session is active. Users can pause, resume, or stop your session by closing the hinges, taking the glasses off (when wear detection is enabled), or tapping the glasses. Learn more in [Session lifecycle](/docs/lifecycle-events). ## Key components `MWDATCore` is the foundation for your integration. It handles: - App registration with the user’s device and registration state - Device discovery and management - Permission requests and state management - Telemetry `MWDATCamera` handles camera access and: - Resolution and frame rate selection - Starting a video stream and sending/listening for pause, resume, and stop signals - Receiving frames from devices - Capturing a single frame during a stream and delivering it to your app - Photo format For more, check out our **API reference documentation**: [iOS](https://wearables.developer.meta.com/docs/reference/ios_swift/dat/0.6), [Android](https://wearables.developer.meta.com/docs/reference/android/dat/0.6). ### Microphones and speakers Use mobile platform functions to access the device over Bluetooth. To use the device's microphones for input, use HFP (Hands-Free Profile). Audio is streamed as 8 kHz mono from the device to your app. ### App management After registration, your app appears in the user’s App Connections list in the Meta AI app, where permissions can be unregistered or managed. ## Next steps - See real-world integration concepts on [our blog](https://developers.meta.com/blog/introducing-meta-wearables-device-access-toolkit/). - Start building your first integration with our step‑by‑step guides for [iOS](/docs/build-integration-ios) and [Android](/docs/build-integration-android). ### Integrate Wearables Device Access Toolkit into your iOS app ## Overview This guide explains how to add Wearables Device Access Toolkit registration, streaming, and photo capture to an existing iOS app. For a complete working sample, compare with the [provided sample app](https://github.com/facebook/meta-wearables-dat-ios/tree/main/samples). ## Prerequisites Complete the environment and glasses steps in [Setup](/docs/getting-started-toolkit). Your integration must use a registered bundle identifier. To register or manage bundle IDs, see Apple's [Register an App ID](https://developer.apple.com/help/account/identifiers/register-an-app-id/) and [Bundle IDs](https://developer.apple.com/documentation/appstoreconnectapi/bundle-ids) documentation. **App Store Submission Warning:** Publishing to the App Store is not currently supported, but we plan to do so in the future. In the meantime, you can share your integration with test users via our [release channels](/docs/set-up-release-channels). As a result, since the SDK currently uses the `ExternalAccessory` framework, it will lead to App Store rejection due to Apple's MFi program and privacy manifest requirements. ## Step 1: Add info properties In your app's `Info.plist`, or using Xcode UI, provide the Wearables Device Access Toolkit with the required keys (`AppLinkURLScheme`, `MetaAppID`, `ClientToken`, `TeamID`). `AppLinkURLScheme` enables the Meta AI app to callback to your app during registration. The example below uses `myexampleapp` as a placeholder, but the real one should be a universal link registered with Apple. Adjust the scheme to match your project. These same identifiers are needed for **attestation** of your app, which ensures its authenticity. While app attestation is *not* used in Developer Mode, if you use incorrect identifiers or your app is misconfigured, it won't connect, and you will receive an error. **Note:** To find your `TeamID`, you must first [Sign in to your developer account](https://developer.apple.com/help/account/access/sign-in-to-your-developer-account). Meanwhile, `ClientToken` and `MetaAppID` are autogenerated in the Wearables Developer Center (see [Manage projects](/docs/manage-projects)). **Note**: If you pre-process `Info.plist`, the `://` suffix will be stripped unless you add the `-traditional-cpp` flag. See [Apple Technical Note TN2175](https://developer.apple.com/library/archive/technotes/tn2175/_index.html#//apple_ref/doc/uid/DTS10004415-CH1-TNTAG3). ```xml CFBundleURLTypes CFBundleTypeRole Editor CFBundleURLName $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleURLSchemes myexampleapp MWDAT AppLinkURLScheme myexampleapp:// MetaAppID $(META_APP_ID) ClientToken $(CLIENT_TOKEN) TeamID $(DEVELOPMENT_TEAM) UISupportedExternalAccessoryProtocols com.meta.ar.wearable UIBackgroundModes bluetooth-peripheral external-accessory NSBluetoothAlwaysUsageDescription Needed to connect to Meta Wearables NSCameraUsageDescription This app needs camera access to stream from your phone's camera as a mock device feed. ``` ## Step 2: Add the SDK Swift package Add the SDK through Swift Package Manager. 1. In Xcode, select **File** > **Add Package Dependencies...** 1. Search for `https://github.com/facebook/meta-wearables-dat-ios` in the top right corner. 1. Select `meta-wearables-dat-ios`. 1. Set the version to one of the [available versions](https://github.com/facebook/meta-wearables-dat-ios/tags). 1. Click **Add Package**. 1. Select the target to which you want to add the package. 1. Click **Add Package**. Import the required modules in any Swift files that use the SDK. ```swift import MWDATCamera import MWDATCore ``` ## Step 3: Initialize the SDK Call [`Wearables.configure()`](https://wearables.developer.meta.com/docs/reference/ios_swift/dat/0.6/mwdatcore_wearables#functions) once when your app launches. ```swift func configureWearables() { do { try Wearables.configure() } catch { assertionFailure("Failed to configure Wearables SDK: \(error)") } } ``` ## Step 4: Launch registration from your app Register your application with the Meta AI app either at startup or when the user wants to turn on your wearables integration. ```swift func startRegistration() throws { try Wearables.shared.startRegistration() } func startUnregistration() throws { try Wearables.shared.startUnregistration() } func handleWearablesCallback(url: URL) async throws { _ = try await Wearables.shared.handleUrl(url) } ``` Observe registration and device updates. ```swift let wearables = Wearables.shared Task { for await state in wearables.registrationStateStream() { // Update your registration UI or model } } Task { for await devices in wearables.devicesStream() { // Update the list of available glasses } } ``` **Important:** A device will **not** appear in the `devicesStream` until the user has granted at least one permission (for example, camera) through the Meta AI app. If your `devicesStream` is empty after registration, ensure you are calling `wearables.requestPermission(.camera)`, as shown in Step 5 below. ## Step 5: Manage camera permissions Check permission status before streaming and request access if necessary. ```swift var cameraStatus: PermissionStatus = .denied ... cameraStatus = try await wearables.checkPermissionStatus(.camera) ... cameraStatus = try await wearables.requestPermission(.camera) ``` ## Step 6: Create device session Use [`createSession`](https://wearables.developer.meta.com/docs/reference/ios_swift/dat/0.6/mwdatcore_wearablesinterface#functions-public) to create a device session and access the capabilities of a Meta Wearable Device. You can also add a stream to a previously created session. You can use [`AutoDeviceSelector`](https://wearables.developer.meta.com/docs/reference/ios_swift/dat/0.6/mwdatcore_autodeviceselector) to make a smart decision for the user to select a device. Alternatively, you can use [`SpecificDeviceSelector`](https://wearables.developer.meta.com/docs/reference/ios_swift/dat/0.6/mwdatcore_specificdeviceselector) if you provide a UI for the user to manually select a specific device. ```swift let deviceSelector = AutoDeviceSelector(wearables: wearables) let session = try wearables.createSession(deviceSelector: deviceSelector) let stateStream = session.stateStream() try session.start() for await state in stateStream { if state == .started { ... } else if state == .stopped { ... } } ``` ## Step 7: Start a camera stream Create a stream by adding it to an existing [`DeviceSession`](https://wearables.developer.meta.com/docs/reference/ios_swift/dat/0.6/mwdatcore_devicesession), and observe its state and display frames. You can request resolution and frame rate control using [`StreamSessionConfig`](https://wearables.developer.meta.com/docs/reference/ios_swift/dat/0.6/mwdatcamera_streamsessionconfig). Valid `frameRate` values are `2`, `7`, `15`, `24`, or `30` FPS. `resolution` can be set to: - `high`: 720 x 1280 pixels - `medium`: 504 x 896 pixels - `low`: 360 x 640 pixels [`StreamSessionState`](https://wearables.developer.meta.com/docs/reference/ios_swift/dat/0.6/mwdatcamera_streamsessionstate) transitions through `stopping`, `stopped`, `waitingForDevice`, `starting`, `streaming`, and `paused`. Register callbacks to collect frames and state events. ```swift let config = StreamSessionConfig( videoCodec: VideoCodec.raw, resolution: StreamingResolution.low, frameRate: 24) guard let stream = try? session.addStream(config: config) else { return } let stateToken = stream.statePublisher.listen { state in Task { @MainActor in // Update your streaming UI state } } let frameToken = stream.videoFramePublisher.listen { frame in guard let image = frame.makeUIImage() else { return } Task { @MainActor in // Render the frame in your preview surface } } Task { await stream.start() } ``` Resolution and frame rate are constrained by the Bluetooth Classic connection between the user’s phone and their AI glasses. To manage limited bandwidth, an automatic ladder reduces quality as needed. It first lowers the resolution by one step (for example, from `high` to `medium`). If bandwidth remains constrained, it then reduces the frame rate (for example, 30 to 24), but never below 15 fps. The image delivered to your app may appear lower quality than expected, even when the resolution reports `high` or `medium`. This is due to per‑frame compression that adapts to available Bluetooth Classic bandwidth. Requesting a lower resolution, a lower frame rate, or both can yield higher visual quality with less compression loss. ## Step 8: Capture and share photos Listen for [`photoDataPublisher`](https://wearables.developer.meta.com/docs/reference/ios_swift/dat/0.6/mwdatcamera_streamsession#properties) events and handle the returned [`PhotoData`](https://wearables.developer.meta.com/docs/reference/ios_swift/dat/0.6/mwdatcamera_photodata). Then, when a stream session is active, call [`capturePhoto`](https://wearables.developer.meta.com/docs/reference/ios_swift/dat/0.6/mwdatcamera_streamsession#functions). ```swift _ = session.photoDataPublisher.listen { photoData in let data = photoData.data // Convert to UIImage or hand off to your storage layer } session.capturePhoto(format: .jpeg) ``` ## Next steps - See details on permission flows in [Permissions and registration](/docs/permissions-requests). - See details on session lifecycles in [Session lifecycle](/docs/lifecycle-events). - Test without a device with [Mock Device Kit](/docs/testing-mdk-ios). - Compare against the [iOS sample app](https://github.com/facebook/meta-wearables-dat-ios/tree/main/samples). - Prepare for release with [Manage projects](/docs/manage-projects) and [Set up release channels](/docs/set-up-release-channels) in the Wearables Developer Center. ### Integrate Wearables Device Access Toolkit into your Android app ## Overview This guide explains how to add Wearables Device Access Toolkit registration, streaming, and photo capture to an existing Android app. For a complete working sample, compare with the [provided sample app](https://github.com/facebook/meta-wearables-dat-android/tree/main/samples). ## Prerequisites Complete the environment and glasses configuration steps in [Setup](/docs/getting-started-toolkit). ## Step 1: Add manifest entries In your app's `AndroidManifest.xml`, add the permissions required to allow your app to communicate with the glasses through Bluetooth. The intent filter with the URI scheme is required so that the Meta AI app can callback to your application. The example below uses `myexampleapp` as a placeholder. Adjust the scheme to match your project. Provide the Wearables Device Access Toolkit with `APPLICATION_ID` and `CLIENT_TOKEN` metadata. Both are needed for **attestation** of your app, which ensures its authenticity, and they can be found in the Wearables Developer Center (see [Manage projects](/docs/manage-projects)). While an App Signature is *not required* for attestation, the Meta AI app will use it to verify the authenticity of your app. If incorrect identifiers are used or your app is misconfigured, it won't connect, and you will receive an error. **Note:** App attestation is *not* used in Developer Mode, since these apps rely on local logic, rather than connecting to a release channel. If you are using Developer Mode, you can omit these values or simply use `0`. ```xml ``` ## Step 2: Add the SDK to Gradle The Wearables Device Access Toolkit is distributed through [GitHub Packages](https://docs.github.com/en/packages/learn-github-packages/introduction-to-github-packages). Add the Wearables Device Access Toolkit Maven repository to your app's Gradle repositories in `settings.gradle.kts`. ```kotlin val localProperties = Properties().apply { val localPropertiesPath = rootDir.toPath() / "local.properties" if (localPropertiesPath.exists()) { load(localPropertiesPath.inputStream()) } } dependencyResolutionManagement { ... repositories { ... maven { url = uri("https://maven.pkg.github.com/facebook/meta-wearables-dat-android") credentials { username = "" // not needed password = System.getenv("GITHUB_TOKEN") ?: localProperties.getProperty("github_token") } } } } ``` Next, declare the Wearables Device Access Toolkit artifacts in `libs.versions.toml`. Check the available versions in [GitHub Packages](https://github.com/orgs/facebook/packages?repo_name=meta-wearables-dat-android). ```toml [versions] mwdat = "0.6.0" [libraries] mwdat-core = { group = "com.meta.wearable", name = "mwdat-core", version.ref = "mwdat" } mwdat-camera = { group = "com.meta.wearable", name = "mwdat-camera", version.ref = "mwdat" } mwdat-mockdevice = { group = "com.meta.wearable", name = "mwdat-mockdevice", version.ref = "mwdat" } ``` Then, add them as dependencies in your app's `build.gradle.kts`. ```kotlin dependencies { implementation(libs.mwdat.core) implementation(libs.mwdat.camera) implementation(libs.mwdat.mockdevice) } ``` To build and install your app with the Wearables Device Access Toolkit, you need a personal access token (classic) with at least the **read:packages** scope in GitHub. Follow [these instructions](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic) to create a new personal access token (classic). Then, provide this personal access token following one of these two approaches: - In a terminal, set the environment variable `GITHUB_TOKEN` with your personal access token. ```bash export GITHUB_TOKEN=ghp... # your personal access token (classic) ./gradlew installDebug # from the directory of the actual project ``` - Alternatively, you can create a `local.properties` file in the project root and set the key `github_token` with your personal access token. Then, in Android Studio, refresh the Gradle project by clicking **File** > **Sync Project with Gradle Files**. ```properties github_token=ghp... # your personal access token (classic) ``` ## Step 3: Initialize the SDK Initialize the SDK once per process at start up. ```kotlin Wearables.initialize(context) ``` Invoking other Wearables Device Access Toolkit APIs before initialization yields [`WearablesError.NOT_INITIALIZED`](https://wearables.developer.meta.com/docs/reference/android/dat/0.6/com_meta_wearable_dat_core_types_wearableserror). For lifecycle placement guidance, read [Session lifecycle](/docs/lifecycle-events). ## Step 4: Launch registration from your app Register your application with the Meta AI app either at startup or when the user wants to turn on your wearables integration. ```kotlin fun requestWearablesRegistration(activity: Activity) { Wearables.startRegistration(activity) } fun requestWearablesUnregistration(activity: Activity) { Wearables.startUnregistration(activity) } ``` Observe registration and device updates. ```kotlin ... Wearables.registrationState.collect { state -> onState(state) } ... Wearables.devices.collect { devices -> onDevices(devices.toList()) } ``` ## Step 5: Manage camera permissions Before streaming, check the Wearables camera permission and launch the SDK contract if required. ```kotlin var permissionStatus = Wearables.checkPermissionStatus(Permission.CAMERA) if (permissionStatus == PermissionStatus.Granted) { // start streaming } permissionStatus = requestWearablesPermission(Permission.CAMERA) ... private var permissionContinuation: CancellableContinuation? = null private val permissionMutex = Mutex() // Requesting wearable device permissions via the Meta AI app private val permissionsResultLauncher = registerForActivityResult(Wearables.RequestPermissionContract()) { result -> permissionContinuation?.resume(result) permissionContinuation = null } // Convenience method to make a permission request in a sequential manner // Uses a Mutex to ensure requests are processed one at a time, preventing race conditions suspend fun requestWearablesPermission(permission: Permission): PermissionStatus { return permissionMutex.withLock { suspendCancellableCoroutine { continuation -> permissionContinuation = continuation continuation.invokeOnCancellation { permissionContinuation = null } permissionsResultLauncher.launch(permission) } } } ``` ## Step 6: Create device session Use [`createSession`](https://wearables.developer.meta.com/docs/reference/android/dat/0.6/com_meta_wearable_dat_core_wearables#functions-public-methods) to create a device session and access the capabilities of a Meta Wearable Device. You can also add a stream to a previously created session. You can use [`AutoDeviceSelector`](https://wearables.developer.meta.com/docs/reference/android/dat/0.6/com_meta_wearable_dat_core_selectors_autodeviceselector) to make a smart decision for the user to select a device. Alternatively, you can use [`SpecificDeviceSelector`](https://wearables.developer.meta.com/docs/reference/android/dat/0.6/com_meta_wearable_dat_core_selectors_specificdeviceselector) if you provide a UI for the user to select a device. ```kotlin val session = Wearables.createSession(AutoDeviceSelector()).getOrElse { error -> showError(error.description) return } session.start() ``` ## Step 7: Start a camera stream Create a stream by adding it to an existing [`Session`](https://wearables.developer.meta.com/docs/reference/android/dat/0.6/com_meta_wearable_dat_core_session_session), and observe its state and display frames. You can request resolution and frame rate control using [`StreamConfiguration`](https://wearables.developer.meta.com/docs/reference/android/dat/0.6/com_meta_wearable_dat_camera_types_streamconfiguration). Valid `frameRate` values are `2`, `7`, `15`, `24`, or `30` FPS. `videoQuality` can be set to: - `HIGH`: 720 x 1280 pixels - `MEDIUM`: 504 x 896 pixels - `LOW`: 360 x 640 pixels [`StreamSessionState`](https://wearables.developer.meta.com/docs/reference/android/dat/0.6/com_meta_wearable_dat_camera_types_streamsessionstate) transitions through `STARTING`, `STARTED`, `STREAMING`, `STOPPING`, `STOPPED`, and `CLOSED`. Register callbacks to collect frames and state events. ```kotlin fun start(deviceId: DeviceIdentifier) { val config = StreamConfiguration(videoQuality = VideoQuality.MEDIUM, frameRate = 24) val streamSession = session.addStream(config) scope.launch { streamSession.videoStream.collect { frame -> displayFrame(frame) } } scope.launch { streamSession.state.collect { state -> updateStreamUi(state) if (state == StreamSessionState.STOPPED) { stopStream() } } } } ``` Resolution and frame rate are constrained by the Bluetooth Classic connection between the user’s phone and their AI glasses. To manage limited bandwidth, an automatic ladder reduces quality as needed. It first lowers the resolution by one step (for example, from `HIGH` to `MEDIUM`). If bandwidth remains constrained, it then reduces the frame rate (for example, 30 to 24), but never below 15 fps. The image delivered to your app may appear lower quality than expected, even when the resolution reports `HIGH` or `MEDIUM`. This is due to per‑frame compression that adapts to available Bluetooth Classic bandwidth. Requesting a lower resolution, a lower frame rate, or both can yield higher visual quality with less compression loss. ## Step 8: Capture and share photos When a stream session is active, call [`capturePhoto`](https://wearables.developer.meta.com/docs/reference/android/dat/0.6/com_meta_wearable_dat_camera_streamsession#functions) and handle the returned [`PhotoData`](https://wearables.developer.meta.com/docs/reference/android/dat/0.6/com_meta_wearable_dat_camera_types_photodata). Add `app/src/main/res/xml/file_paths.xml` so that the FileProvider can expose cached images. ```kotlin session.capturePhoto() .onSuccess { data -> ... } .onFailure(onError) ``` ## Next steps - See details on permission flows in [Permissions and registration](/docs/permissions-requests). - See details on session lifecycles in [Session lifecycle](/docs/lifecycle-events). - Test without a device with [Mock Device Kit](/docs/testing-mdk-android). - Compare against the [Android sample app](https://github.com/facebook/meta-wearables-dat-android/tree/main/samples). - Prepare for release with [Manage projects](/docs/manage-projects) and [Set up release channels](/docs/set-up-release-channels) in the Wearables Developer Center. ### Session lifecycle ## Overview The Wearables Device Access Toolkit runs inside sessions. Meta AI glasses expose two experience types: - **Device sessions** grant sustained access to device sensors and outputs. - **Transactions** are short, system-owned interactions (for example, notifications or "Hey Meta"). When your app requests a device session, the glasses grant or revoke access as needed, the app observes state, and the system decides when to change it. ## Device session states `SessionState` is device-driven and delivered asynchronously. On Android, observe the state using [`getDeviceSessionState()`](https://wearables.developer.meta.com/docs/reference/android/dat/0.6/com_meta_wearable_dat_core_wearables#getdevicesessionstate). On iOS, use [`addDeviceSessionStateListener()`](https://wearables.developer.meta.com/docs/reference/ios_swift/dat/0.6/mwdatcore_wearablesinterface#adddevicesessionstatelistener). | State | Meaning | App expectation | |--------------------|--------------------------------------------|---------------------------------------| | `STOPPED` | Session is inactive and not reconnecting. | Free resources. Wait for user action. | | `RUNNING` | Session is active and streaming data. | Perform live work. | | `PAUSED` | Session is temporarily suspended. | Hold work. Paths may resume. | **Note:**  `SessionState` does not expose the reason for a transition. Observe the `SessionState` and react without assuming the cause of a change. **Android** ```kotlin Wearables.getDeviceSessionState(deviceId).collect { state -> when (state) { SessionState.RUNNING -> onRunning() SessionState.PAUSED -> onPaused() SessionState.STOPPED -> onStopped() } } ``` **iOS** ```swift let token = await Wearables.shared.addDeviceSessionStateListener( forDeviceId: deviceId, listener: { state in switch state { case .running: onRunning() case .paused: onPaused() case .stopped: onStopped() default: break } } ) ``` Recommended reactions: - On `RUNNING`, confirm UI shows that the device session is live. - On `PAUSED`, keep the connection and wait for `RUNNING` or `STOPPED`. - On `STOPPED`, release device resources and allow the user to restart. ## Common device session transitions The device can change `SessionState` when: - The user performs a system gesture that opens another experience. - Another app or system feature starts a device session. - The user removes or folds the glasses, disconnecting Bluetooth. - The user removes the app from the Meta AI app. - Connectivity between the Meta AI app and the glasses drops. Many events lead to `STOPPED`, while some gestures pause a session and later resume it. ## Pause and resume When `SessionState` changes to `PAUSED`: - The device keeps the connection alive. - Streams stop delivering data while paused. - The device resumes streaming by returning to `RUNNING`. Your app should not attempt to restart a device session while it is paused. ## Device availability Use device metadata to detect availability. Hinge position is not exposed, but it influences connectivity. Again, for an Android integration: **Android** ```kotlin Wearables.devicesMetadata[deviceId]?.collect { metadata -> if (metadata.available) { onDeviceAvailable() } else { onDeviceUnavailable() } } ``` **iOS** ```swift let token = Wearables.shared.deviceForIdentifier(deviceId).addLinkStateListener { linkState in if linkState == .connected { onDeviceAvailable() } else { onDeviceUnavailable() } } ``` Expected effects: - Closing the hinges disconnects Bluetooth, stops active streams, and forces `SessionState` to `STOPPED`. - Opening the hinges restores Bluetooth when the glasses are nearby, but does not restart the device session. Start a new session after the device becomes available/connected. ## Implementation checklist - Subscribe to `getDeviceSessionState`/`addDeviceSessionStateListener` and handle all `SessionState` values. - Monitor device availability before starting work. - Release resources only after receiving `STOPPED` or loss of availability. - Rely only on observable state rather than inferring transition causes. ### Permissions and registration ## Overview The Wearables Device Access Toolkit separates app registration and device permissions. All permission grants occur through the Meta AI app. Permissions work across multiple linked wearables. Camera permissions are granted at the app level. However, each device will need to confirm permissions specifically, in turn allowing your app to support a set of devices with individual permissions. To create an integration, follow this guidance to build your first integration for [Android](/docs/build-integration-android) or [iOS](/docs/build-integration-ios). ## Registration Your app registers with the Meta AI app to be an permitted integration. This establishes the connection between your app and the glasses platform. Registration happens once through Meta AI app with glasses connected. Users see your app name in the list of connected apps. They can unregister anytime through the Meta AI app. You can also implement an unregistration flow is desired. ## Device permissions After registration, request specific permissions (see possible values for [Android](https://wearables.developer.meta.com/docs/reference/android/dat/0.6/com_meta_wearable_dat_core_types_permission#enumeration_constants) and [iOS](https://wearables.developer.meta.com/docs/reference/ios_swift/dat/0.6/mwdatcore_permission#enumeration_constants)). The Meta AI app runs the permission grant flow. Users choose **Allow once** (temporary) or **Allow always** (persistent). ### User experience flow ![Illustrating the user experience flow for permissions and using features.](/images/wearables-permissions-request-1.png) - Without registration, permission requests fail. - With registration but no permissions, your app connects but cannot access camera. ## Multi-device permission behavior Users can link multiple glasses to Meta AI. The toolkit handles this transparently. ### How it works Users can have multiple pairs of glasses. Permission granted on any linked device allows your app to use that feature. When checking permissions, Wearables Device Access Toolkit queries all connected devices. If any device has the permission granted, your app receives "granted" status. ### Practical implications You don't track which specific device has permissions. Permission checks return granted if _any_ connected device has approved. If all devices disconnect, permission checks will indicate unavailability. Users manage permissions per device in the Meta AI app. ## Distribution and registration Testing vs. production have different permission requirements. When developer mode is activated, registration is always allowed. When a build is distributed, users must be in the proper release channel to get the app. This is controlled by the `MWDAT` application ID. **Note:** For security purposes, only one 3rd party app can remain registered at a time in Developer Mode. Registering a new app will automatically unregister any previously registered app. - For setting up developer mode, see [Getting started with the Wearables Device Access Toolkit](/docs/getting-started-toolkit). - For details on creating release channels, see [Manage projects in Developer Center](/docs/manage-projects). - This page also explains where to find the `APPLICATION_ID` that must be added to your production manifest/bundle configuration. ### Use device microphones and speakers ## Overview Device audio uses two Bluetooth profiles: - A2DP (Advanced Audio Distribution Profile) for high‑quality, output‑only media - HFP (Hands‑Free Profile) for two‑way voice communication **Note on Audio Quality:** HFP streams audio at 8kHz in mono. The wearable device's microphones use beamforming to isolate and clarify the wearer's voice, which significantly reduces the volume of ambient sounds and other speakers. This is an expected limitation. ## Integrating sessions with HFP Wearables Device Access Toolkit sessions share microphone and speaker access with the system Bluetooth stack on the glasses. ## iOS sample code ```swift // Set up the audio session let audioSession = AVAudioSession.sharedInstance() try audioSession.setCategory(.playAndRecord, mode: .default, options: [.allowBluetooth]) try audioSession.setActive(true, options: .notifyOthersOnDeactivation) ``` **Note:** When planning to use HFP and streaming simultaneously, ensure that HFP is fully configured before initiating any streaming session that requires audio functionality. ```swift func startStreamSessionWithAudio() async { // Set up the HFP audio session startAudioSession() // Instead of waiting for a fixed 2 seconds, use a state-based coordination that waits for HFP to be ready try? await Task.sleep(nanoseconds: 2 * NSEC_PER_SEC) // Start the stream session as usual await streamSession.start() } ``` ## Android sample code ```kotlin private fun routeAudioToBluetooth() { val audioManager = context.getSystemService(Context.AUDIO_SERVICE) as AudioManager // Get list of currently available devices val devices = audioManager.availableCommunicationDevices // User chooses one of the devices from the list val userSelectedDeviceType = AudioDeviceInfo.TYPE_BLUETOOTH_SCO var selectedDevice: AudioDeviceInfo? = null for (device in devices) { if (device.type == userSelectedDeviceType) { selectedDevice = device break } } if (selectedDevice != null) { audioManager.mode = AudioManager.MODE_NORMAL audioManager.setCommunicationDevice(selectedDevice) } } ``` For guidance on how to use audio in your app, refer to the corresponding iOS API and Android API docs: - iOS API: [AVAudioSession](https://developer.apple.com/documentation/AVFAudio/AVAudioSession) - Android API: [AudioManager](https://developer.android.com/reference/android/media/AudioManager) ### Mock Device Kit ## Overview Mock Device Kit is a component of the Device Access Toolkit that helps you build and test integrations for Meta glasses, without the need to access the actual hardware. This kit provides a simulated device that mirrors the capabilities and behavior of Meta glasses, including camera, media streaming, permissions, and device state changes. You can use it to test your app integrations in a virtual environment. This is useful for rapid iteration, automated testing, and development workflows where physical devices may not be available or practical to use. **Note:** This page demonstrates how the Mock Device Kit is used in the CameraAccess sample. For information on using Mock Device Kit APIs in your own testing, see [Android testing with Mock Device Kit](/docs/testing-mdk-android) or [iOS testing with Mock Device Kit](/docs/testing-mdk-ios). ## Mock Device Kit in the CameraAccess sample To connect to a simulated device using the sample app: 1. Tap the **Debug icon** on your mobile device. You will see the Mock Device Kit menu open. 2. Tap **Pair RayBan Meta**. A Mock Device card is then added to the view. 3. Swipe down the **Mock Device Kit** menu. The new device should now be available. ![Image showing how to connect Mock Device Kit](/images/mock-device-kit-connecting-to.png){:width="60%"} ## Changing state Now that your mock device is paired, you can alter the state of your virtual device: - To simulate powering on the glasses, tap **PowerOn**. The device must change to "Connected" on the main screen. - To simulate unfolding the glasses, tap **Unfold**. The device is now ready for streaming. - To simulate putting on the glasses, tap **Don**. **Note**: CameraAccess automatically checks camera permissions when you start streaming. If permission isn't granted, the app redirects to Meta AI to complete the flow. ## Simulating media streaming To test your app's media handling capabilities, you can configure the Mock Device Kit with sample media files that simulate video streaming and photo capture from the glasses. ### Streaming video 1. Set your mock device to **Unfold**. 2. Click **Select video** and select any supported video. This video will be used as mock streaming video. **Note**: Android doesn’t transcode video automatically. Any video used here must be in h265 format. To transcode a video to h265, you can use [FFmpeg](https://www.ffmpeg.org/). For example: ```bash ffmpeg -hwaccel videotoolbox -i input_video.mp4 -c:v hevc_videotoolbox -c:a aac_at -tag:v hvc1 -vf "scale=540:960" output_video.mov ``` ### Image capture 1. Tap **Select image** and select any supported photo. This photo will be used as a mock capture result. 2. Go to the main screen, navigate to the device, and start streaming. You can try capture here as well. ### How to test with Mock Device Kit on iOS ## Overview Use this guide when your iOS project already integrates the Wearables Device Access Toolkit and you need to test without physical glasses. ## Set up Mock Device Kit in XCTest Create a reusable base rule or test class that configures Mock Device Kit, grants permissions, and resets state. ```swift import XCTest import MetaWearablesDAT @MainActor class MockDeviceKitTestCase: XCTestCase { private var mockDevice: MockRaybanMeta? private var cameraKit: MockCameraKit? override func setUp() async throws { try await super.setUp() try? Wearables.configure() mockDevice = MockDeviceKit.shared.pairRaybanMeta() cameraKit = mockDevice?.getCameraKit() } override func tearDown() async throws { MockDeviceKit.shared.pairedDevices.forEach { device in MockDeviceKit.shared.unpairDevice(device) } mockDevice = nil cameraKit = nil try await super.tearDown() } } ``` ## Configure camera feeds for streaming tests Mock camera feeds let you verify streaming and capture workflows without video hardware. ### Provide a mock video feed ```swift guard let device = MockDeviceKit.shared.pairRaybanMeta() else { return } let camera = device.getCameraKit() await camera.setCameraFeed(fileURL: videoURL) ``` ### Provide a captured photo ```swift guard let device = MockDeviceKit.shared.pairRaybanMeta() else { return } let camera = device.getCameraKit() await camera.setCapturedImage(fileURL: imageURL) ``` ### How to test with Mock Device Kit on Android ## Overview Use this guide when your Android project already integrates the Wearables Device Access Toolkit and you need to test without physical glasses. The tasks below help you: ## Set up Mock Device Kit in instrumentation tests Create a reusable base rule or test class that configures Mock Device Kit, grants permissions, and resets state. ```kotlin import android.content.Context import androidx.test.ext.junit.rules.ActivityScenarioRule import androidx.test.platform.app.InstrumentationRegistry import com.meta.wearable.dat.mockdevice.MockDeviceKit import com.meta.wearable.dat.mockdevice.api.MockDeviceKitInterface import org.junit.After import org.junit.Before import org.junit.Rule open class MockDeviceKitTestCase( private val activityClass: Class ) { @get:Rule val scenarioRule = ActivityScenarioRule(activityClass) protected lateinit var mockDeviceKit: MockDeviceKitInterface protected lateinit var targetContext: Context @Before open fun setUp() { val instrumentation = InstrumentationRegistry.getInstrumentation() targetContext = instrumentation.targetContext mockDeviceKit = MockDeviceKit.getInstance(targetContext) grantRuntimePermissions() } @After open fun tearDown() { mockDeviceKit.reset() } private fun grantRuntimePermissions() { val packageName = targetContext.packageName val shell = InstrumentationRegistry.getInstrumentation().uiAutomation shell.executeShellCommand("pm grant $packageName android.permission.BLUETOOTH_CONNECT") shell.executeShellCommand("pm grant $packageName android.permission.CAMERA") } } ``` ## Configure camera data for streaming and capture Mock camera feeds let you test streaming logic without hardware. The examples below assume assets live under `androidTest/assets`. ### Provide a mock video feed ```kotlin @Test fun testCameraStreaming() { val device = mockDeviceKit.pairRaybanMeta() prepareForStreaming(device) val mockCameraKit = device.getCameraKit() mockCameraKit.setCameraFeed(getAssetUri("test_video.mp4")) // Assert on streaming state in your UI } ``` ### Provide a captured photo ```kotlin @Test fun testPhotoCapture() { val device = mockDeviceKit.pairRaybanMeta() prepareForStreaming(device) val mockCameraKit = device.getCameraKit() mockCameraKit.setCapturedImage(getAssetUri("test_image.png")) // Assert on capture results } ``` ### AI-Assisted Development ## Overview The Wearables Device Access Toolkit provides two levels of AI assistance for developers: 1. **Project-level config** — SDK knowledge (setup guides, streaming patterns, testing, debugging) delivered directly to your AI tool via config files in the GitHub repos. This is the primary integration path. 2. **API reference endpoint** — The full API surface served via [llms.txt](https://llmstxt.org/) as a supplementary reference for on-demand queries. ## Project-level config The SDK GitHub repos ship config files for four AI coding tools. Each tool gets the same SDK knowledge — setup guides, streaming patterns, MockDeviceKit testing, session lifecycle, permissions, debugging, and sample app guidance — in whatever format it expects. | Tool | Config | How it loads | |------|--------|-------------| | [Claude Code](https://docs.anthropic.com/en/docs/claude-code) | `.claude/skills/*.md` | Auto-discovered when you open the project | | [GitHub Copilot](https://github.com/features/copilot) | `.github/copilot-instructions.md` | Auto-loaded by Copilot in VS Code | | [Cursor](https://cursor.sh/) | `.cursor/rules/*.mdc` | Auto-loaded with glob-based triggers | | [AGENTS.md](https://agents.md) | `AGENTS.md` | Universal — auto-discovered by Codex, Gemini CLI, Devin, Windsurf, Jules, and others | See the dedicated setup guides for each tool: [Claude Code](/docs/ai-assisted-claude-code), [GitHub Copilot](/docs/ai-assisted-github-copilot), [Cursor](/docs/ai-assisted-cursor), [AGENTS.md](/docs/ai-assisted-agents-md). ### Setup If you cloned the SDK repo, the config is already included — no extra setup needed. Otherwise, use the installer to add it to an existing project: ```bash ./install-skills.sh claude # Claude Code only ./install-skills.sh copilot # GitHub Copilot only ./install-skills.sh cursor # Cursor only ./install-skills.sh agents # AGENTS.md only ./install-skills.sh all # All tools ``` Or install everything remotely with a single command: iOS: ```bash curl -sL https://raw.githubusercontent.com/facebook/meta-wearables-dat-ios/main/install-skills.sh | bash ``` Android: ```bash curl -sL https://raw.githubusercontent.com/facebook/meta-wearables-dat-android/main/install-skills.sh | bash ``` ### What the config covers All four tools receive the same SDK knowledge, covering: - **Getting started** — Dependencies, project setup, and first integration - **Session lifecycle** — Connecting, reconnecting, and managing device sessions - **Camera streaming** — Resolution selection, frame rates, and photo capture - **Permissions** — Requesting and handling device permissions - **MockDeviceKit** — Testing without physical hardware - **Debugging** — Common issues, Developer Mode, version compatibility - **Sample app guide** — Building a complete DAT app from scratch ## API reference endpoint (llms.txt) As a supplement to the project-level config, the SDK provides an [llms.txt](https://llmstxt.org/) endpoint with the full API surface. The project config covers integration patterns and best practices; the endpoint covers the API reference (classes, methods, parameters, return types). ### Endpoints | Endpoint | Description | |----------|-------------| | [wearables.developer.meta.com/llms.txt](https://wearables.developer.meta.com/llms.txt) | Index of available documentation sections with links | | [wearables.developer.meta.com/llms.txt?full=true](https://wearables.developer.meta.com/llms.txt?full=true) | Full API reference content in a single document | The index endpoint follows the [llms.txt specification](https://llmstxt.org/) and returns a lightweight listing of documentation sections. The `?full=true` variant returns the complete API reference inline, which is what most AI tools need to write code. ### What's included The endpoint serves API reference documentation for both iOS (Swift) and Android (Kotlin) platforms, covering: - `MWDATCore` — App registration, device discovery, session management, and telemetry - `MWDATCamera` — Camera access, resolution and frame rate selection, and photo capture - `MWDATMockDevice` — Simulated device for testing without physical hardware ## Tips for effective use - **Start with the project-level config** — Clone the repo or run the installer. The project-level config gives your AI tool the integration patterns, best practices, and debugging guidance it needs for most tasks. - **Add the API reference when you need specifics** — If your AI tool can't find a particular method signature or parameter type, point it at the llms.txt endpoint for the full API surface. - **Be specific in your prompts** — Mention the platform (iOS or Android) and the module you're working with (`MWDATCore`, `MWDATCamera`, or `MWDATMockDevice`). - **Combine with the guides** — For deeper integration patterns and lifecycle management, point your AI tool at the [integration overview](/docs/build-overview) and platform-specific integration guides ([iOS](/docs/build-integration-ios), [Android](/docs/build-integration-android)). ### Claude Code ## Overview [Claude Code](https://docs.anthropic.com/en/docs/claude-code) auto-discovers the `.claude/` directory when you open a project that contains it. No manual configuration is required. Once loaded, Claude Code has full context on the SDK and can help you: - Set up your project and adding DAT SDK dependencies - Implement camera streaming, session lifecycle, and permissions - Write tests with Mock Device Kit - Debug common integration issues ## Setup If you cloned the SDK repo, the `.claude/` directory is already included. Otherwise, install it with the CLI: ```bash ./install-skills.sh claude ``` Or install remotely: iOS: ```bash curl -sL https://raw.githubusercontent.com/facebook/meta-wearables-dat-ios/main/install-skills.sh | bash -s claude ``` Android: ```bash curl -sL https://raw.githubusercontent.com/facebook/meta-wearables-dat-android/main/install-skills.sh | bash -s claude ``` ## Usage Start Claude Code in your project directory: ```bash claude ``` You can then ask it about any DAT SDK topic, have it implement a specific app functionality, or make it write tests — the skills are already loaded: ```text > How do I set up camera streaming in my Android app? > Write a test for my session lifecycle using MockDeviceKit ``` ## Adding the API reference The project-level config covers integration patterns and best practices. To also include the full API reference, paste the llms.txt URL directly into your Claude Code prompt: ```text > Using https://wearables.developer.meta.com/llms.txt?full=true as reference, what parameters does StreamSession accept? ``` Or add it to your `.claude/CLAUDE.md` so it loads automatically: ```markdown ## API Reference Fetch https://wearables.developer.meta.com/llms.txt?full=true for the Wearables DAT SDK API reference. ``` Claude Code will fetch and read the URL contents automatically when you include it in your prompt. ### GitHub Copilot ## Overview [GitHub Copilot](https://github.com/features/copilot) auto-loads `.github/copilot-instructions.md` when you open a project in VS Code. The SDK knowledge is available in Copilot Chat immediately. Copilot also provides inline completions as you write DAT SDK code — the project config gives it enough context to suggest correct API usage, parameter names, and patterns. ## Setup If you cloned the SDK repo, the `.github/copilot-instructions.md` file is already included. Otherwise, install with the CLI: ```bash ./install-skills.sh copilot ``` Or install remotely: iOS: ```bash curl -sL https://raw.githubusercontent.com/facebook/meta-wearables-dat-ios/main/install-skills.sh | bash -s copilot ``` Android: ```bash curl -sL https://raw.githubusercontent.com/facebook/meta-wearables-dat-android/main/install-skills.sh | bash -s copilot ``` ## Usage Use Copilot Chat to ask SDK questions directly: ```text How do I request camera permissions in my iOS DAT app? ``` ## Adding the API reference The project-level config covers integration patterns and best practices. To also pull in the full API reference during a chat session, paste the URL directly into your Copilot Chat prompt: ```text Using https://wearables.developer.meta.com/llms.txt?full=true as reference, what parameters does MWDATCameraSession.startStreaming accept? ``` Copilot Chat fetches and reads URL contents automatically when you include them in your prompt. ### Cursor ## Overview [Cursor](https://cursor.sh/) auto-loads `.cursor/rules/*.mdc` files with glob-based triggers. When you're editing a file that matches a rule's glob pattern, Cursor loads the relevant SDK knowledge automatically. ## Setup If you cloned the SDK repo, the `.cursor/` directory is already included. Otherwise, install with the CLI: ```bash ./install-skills.sh cursor ``` Or install remotely: iOS: ```bash curl -sL https://raw.githubusercontent.com/facebook/meta-wearables-dat-ios/main/install-skills.sh | bash -s cursor ``` Android: ```bash curl -sL https://raw.githubusercontent.com/facebook/meta-wearables-dat-android/main/install-skills.sh | bash -s cursor ``` ## Usage Use Cursor Chat or inline editing to ask SDK questions: ```text Set up a DAT session with camera streaming and handle lifecycle events. ``` ## Adding the API reference The project-level config covers integration patterns and best practices. To add the full API reference as a persistent documentation source: 1. Open **Settings** > **Features** > **Docs**. 2. Click **Add new doc**. 3. Enter `https://wearables.developer.meta.com/llms.txt?full=true` as the URL. 4. Name it "Wearables DAT SDK". Once added, reference it in Cursor Chat with `@Docs`, and then and select the Wearables DAT SDK entry. ### AGENTS.md ## Overview [AGENTS.md](https://agents.md) is an open standard for guiding AI coding agents. It provides a universal, tool-agnostic way to give any AI assistant context about your project, using the same SDK knowledge that powers our Claude Code, Copilot, and Cursor configs, in a format supported by 20+ AI tools. ## What is AGENTS.md? `AGENTS.md` is a predictable, discoverable file at the repo root that any AI coding agent can find and use. Key properties: - **Standard Markdown** — no required fields or special syntax - **Closest file wins** — supports nested files for monorepos - **Open standard** — stewarded by the Linux Foundation's Agentic AI Foundation - **Widely supported** — works with Codex, Gemini CLI, Devin, Windsurf, Jules, Cursor, VS Code, Zed, Aider, and others It's complementary to `README.md`, but where README is for humans, AGENTS.md is for AI agents, providing additional context that might otherwise clutter a README. ## Which tools support it? AGENTS.md is supported by a growing ecosystem of AI coding tools, all of which have support for auto-discover: * OpenAI Codex * Google Gemini CLI * Devin * Windsurf * Jules * Cursor * VS Code (GitHub Copilot) * Zed * Aider ## What's included The Device Access Toolkit SDK's `AGENTS.md` file contains the same knowledge as our other tool configs — SDK architecture, API patterns, setup instructions, testing guides, and debugging tips — but structured for universal agent consumption: - **Code style** — Architecture, naming conventions, error handling patterns - **Dev environment tips** — SDK setup, dependency management, initialization - **Testing instructions** — MockDeviceKit setup and test patterns - **Building and streaming** — StreamSession, VideoFrame, photo capture - **Session management** — Device session states, pause/resume behavior - **Permissions** — Registration and camera permission flows - **Debugging** — Common issues, Developer Mode, version compatibility - **Sample app** — Complete end-to-end integration example ## Setup ### Already included in the repo Both SDK repositories include `AGENTS.md` at the root: - [Android](https://github.com/facebook/meta-wearables-dat-android) — `AGENTS.md` - [iOS](https://github.com/facebook/meta-wearables-dat-ios) — `AGENTS.md` Once you clone the repo, any supported AI tool will auto-discover it. ### Adding to your own project Use the installer script: Android: ```bash curl -sL https://raw.githubusercontent.com/facebook/meta-wearables-dat-android/main/install-skills.sh | bash -s -- agents ``` iOS: ```bash curl -sL https://raw.githubusercontent.com/facebook/meta-wearables-dat-ios/main/install-skills.sh | bash -s -- agents ``` Or install all tool configs at once: ```bash curl -sL https://raw.githubusercontent.com/facebook/meta-wearables-dat-android/main/install-skills.sh | bash -s -- all ``` ## Other tool configs The SDK also includes project-level configs for specific AI tools. See the [AI-Assisted Development overview](/ai-assisted/) for the full list. ### Onboarding and organization management Wearables Developer Center manages the full lifecycle of wearables integrations, from development and testing to app sharing. It oversees integration projects, versions, and release channels. To manage your team and projects effectively, you need to understand organizational roles and account requirements. This guide explains how to set up and manage your organization, team, and members. ## One organization per company **Important:** Each company must have only **one** Managed Meta Account (MMA) organization in [Admin Center.](https://work.meta.com/admin/work_tools_overview) **Do not create a new MMA organization if one already exists for your company.** Check with your IT, engineering lead, or project manager before proceeding. ## Key terms | Term | Definition | | ------------------------------ | ------------------------------------------------------------------------------ | | **Managed Meta Account (MMA)** | A Meta account managed by an organization admin for secure access and control. | | **Admin Center** | A portal for managing IT tasks related to people management and security. | | **Organization** | Represents your company in Admin Center | | **Team** | A group within Wearables Developer Center representing your project team. | ## Set up your organization and team ### 1. Check for an existing MMA Organization - **Before you start:** Ask your company's IT, engineering lead, or project manager if an MMA organization already exists in Admin Center. ### 2. Designate an organization admin - Only one person (ideally IT, engineering lead, or project manager) should create the MMA organization for your company. - This person becomes the MMA organization admin and manages membership for all contributors. You can change [admin roles in Admin Center](https://work.meta.com/help/632623761283671) if needed. ### 3. Create the MMA organization in Admin Center - The admin should sign up to Wearables Developer Center. During this process they will be redirected to the MMA setup in [work.meta.com](https://work.meta.com/). - Use your company’s official name for the organization. ![Screenshot of Wearables Developer Center login screen](start-in-wdc.png) ### 4. Invite developers to the MMA organization - The admin invites all developers and contributors who need access to Wearables Developer Center. - Invited members will receive prompts to create or link their MMA. - **Note:** Only members of your company’s MMA organization can join your Wearables Developer Center team. ### 5. Access Wearables Developer Center - Once your MMA and organization membership are set up, log into Wearables Developer Center with your MMA credentials. ### 6. Invite team members in Wearables Developer Center - You will have a default personal team when you first log into Wearables Developer Center with your MMA account. You can create a new team and/or add people to your existing team. You don't have to be admin in Admin Center to do this. - Only developers in the same MMA organization can join Wearables Developer Center team. - Use the **Invite Member** process. If invitees lack an MMA, they will be prompted to create one and join the organization. ## Get started in Wearables Developer Center Use Wearables Developer Center to: - Create and manage AI glasses projects, including device permissions and connectivity. - Manage integration versions (Major, Minor, Patch). - Invite testers to [release channels](https://wearables.developer.meta.com/docs/set-up-release-channels). ## Invite team members: admin rights - **If you're an admin in Admin Center:** - **Option 1:** Set up the new member's MMA first, then invite them via Wearables Developer Center. - **Option 2:** Invite directly from Wearables Developer Center; if the person lacks an MMA, they will receive an email to create one. - **If you are not an admin:** - You can only invite people who already have an MMA. Organizational setup remains the administrator's responsibility. ## Add, remove, or leave a team **Add a member:** 1. Select your team from the dropdown menu in the top left of Wearables Developer Center. 2. Click **Settings** in the left menu. 3. Click **Invite member**. 4. Enter the member’s email (must be linked to a Managed Meta account). 5. Click **Add**. The invitee receives an invitation email. **Remove a member:** 1. Select your team from the dropdown menu in the top left. 2. Click **Settings** in the left menu. 3. Find the member below **Members** and click **Remove member**. 4. Confirm by clicking **Remove**. **Leave a team:** 1. Select your team from the dropdown menu in the top left. 2. Click **Settings** in the left menu. 3. Next to your name below **Members**, click the delete icon. 4. Confirm by clicking **Remove member**. ### Manage projects Once you have [onboarded](https://work.meta.com/signup/landing/wearables_dev/?signup_code=Ae4HLaAAGqKWzrY23IYi8Sjdo3KDeP8pnrwduotfeJOYUwBXSjK1krB7t6vXxtqXavXI5bfIjnLeIEb6g3piWHM51GCndj6kRSE&request_id=filcemlbbnolpolgkigehjpjkofhkogdkheckidi), you can create a project or manage existing ones in [Meta Wearables Developer Center](https://work.meta.com/signup/landing/wearables_dev/?signup_code=Ae4HLaAAGqKWzrY23IYi8Sjdo3KDeP8pnrwduotfeJOYUwBXSjK1krB7t6vXxtqXavXI5bfIjnLeIEb6g3piWHM51GCndj6kRSE&request_id=filcemlbbnolpolgkigehjpjkofhkogdkheckidi). ## Projects You can create new projects or manage your existing ones directly in the Wearables Developer Center. ## Create a project 1. Click **New Project**. 2. Give your project a name (what you want to call it) and a brief description (what it does). ## App configuration You can connect your own mobile apps with your wearable device (for example, Meta AI glasses) by defining the app details. Click **App configuration**. 1. Add the requested details for a mobile app you want to integrate with Meta wearable devices. ### Application ID integration To register your application successfully (without using Developer Mode), you must include the Wearables Application ID in your app’s manifest and pass it in the registration call. Copy and paste the integration details into your iOS or Android application build to complete this step. ## Product listing **App name and icon** - You need to provide your app's name and an icon. - The icon must be in PNG or JPEG format. - Separate icons for dark and light mode are supported. - The maximum supported dimensions for the icon are 200x200 pixels. These details will also be visible to other users in the Meta AI app when they [adjust permissions](https://wearables.developer.meta.com/docs/set-up-release-channels#manage-permissions-for-connected-apps). ## Permissions If your app or project needs access to device functionality like the camera, you must provide a justification in the **Permissions** tab. This justification is for Meta’s internal review only and is not shown to end-users. Reviewers use your explanation to determine if the permission is necessary and appropriate for your app’s functionality. > **Note:** Currently, the only permission is camera, but new device > capabilities will be added in future iterations. ## Distribute When you’re ready for people to try your project, you need to [set up release channels](https://wearables.developer.meta.com/docs/set-up-release-channels). ### Set up versions and release channels in Meta Wearables Developer Center Effectively manage how you distribute and test Meta integrations by setting up versions and release channels in the Meta Wearables Developer Center. This guide walks you through best practices and step-by-step instructions to help you roll out updates, gather meaningful feedback, test features safely, and maintain integration quality. ## Understand versions Wearables Developer Center uses a versioning system that helps track changes and maintain stability across your integrations. Each version details product specifics, including the name, icon, and any edits to permission requests or app configuration. After you add and save these details you can find them by going to **Distribute > Version details > Project data**. When you change any of these details, you need to create a new version of the integration so you can distribute it to testers on a release channel. When selecting the version to use, the type of change you are making determines the category you should choose: - **Major (e.g., 2.3.4 to 3.0.0):** Choose this for significant changes or API revisions that are not guaranteed to maintain compatibility with previous versions. For example, select a major version if you change core app functionality in a way that breaks existing features. - **Minor (e.g., 2.3.4 to 2.4.0):** Select a minor version when introducing new features while still maintaining backwards compatibility. For example, if you add a new button or feature. - **Patch (e.g., 2.3.4 to 2.3.5):** Use a patch version for fixing bugs or delivering minor improvements that do not break compatibility, such as correcting a typo or a small bug fix. ## Create versions To create a new version of your integration: 1. Log in to the [Meta Wearables Developer Center](https://wearables.developer.meta.com/). 2. Select your project from the dashboard. 3. Go to the **Distribute** menu and choose **Versions**. 4. Click **+ New version**. 5. Select your version type (**Major, Minor, or Patch**). 6. Click **Create version**. ## About release channels Release channels let you control distribution of your versions. By creating and assigning versions to specific channels, you determine which user groups access each version. Each channel supports only one version at a time, but you can attach the same version to multiple channels if needed. ### Release channel options - **Invite-only channels:** Useful for alpha/beta testing. All release channels for Device Access Toolkit are currently invite-only. - **User invitations by email:** You can only invite testers who have [Meta accounts](https://developers.meta.com/horizon/blog/introducing-meta-accounts-what-developers-need-to-know/). Make sure to add the email associated with the tester’s Meta account when prompted to invite testers. - **Tester autonomy:** Testers may accept or decline invitations and can remove themselves at any time. - **Developer control:** You can revoke tester access at any point. You can also reinvite users you have previously revoked. - **Limitations:** Up to 3 channels per integration, max 100 users per channel. ## Create a release channel To set up a new release channel: 1. In the **Distribute** menu, click **Release channels** (right menu, adjacent to **Versions**). 2. Select **+ Create a release channel**. 3. Enter a unique **Name** and a clear **Description** for your channel. Click **Next**. 4. Select the **Version** you wish to distribute. You can update this selection whenever needed. Click **Next**. 5. Enter the email addresses of the testers you wish to invite. **Note:** These must be emails for already existing Meta Accounts (this is different from a Meta Managed Account). If the tester needs a Meta Account, they can create one at [meta.ai](http://meta.ai/) or by logging into the Meta AI app. 6. Click **Next**. 7. Review your selections, then click **Create release channel** to confirm. If you do not confirm by clicking this button, users will not receive the invitation. ## Manage test user access Testers can belong to multiple release channels for one integration, such as for regression or parallel testing. Each invited tester must accept the email invitation to join a test group. Developers can remove testers, and testers can leave at any time. **Note:** Release channels control a user's ability to register an app integration. Removing a user from a channel after they've registered will not unregister the connected app for Meta AI and the wearable device. To view release channel details and manage test users, click **Edit** next to the channel. From here, you can also change the distributed version. Test users can view the integrations they are testing at: [https://wearables.meta.com/invites](https://wearables.meta.com/invites) ## Manage permissions and switch release channels in the Meta AI app People testing your integration can manage app permissions and switch release channels for your devices and connected apps in the Meta AI app. These settings help you control what your connected apps can access and allow you to try new features by joining different release channels. ## Manage permissions for connected apps As a test user, managing permissions lets you control what each integration can access on your device. To manage permissions: 1. Open the Meta AI App. 2. Go to the device menu and tap **Settings**. 3. Select **Connected Apps** to see a list of all apps linked to your Meta AI account. 4. Tap on an app to view its permissions. 5. Adjust specific permissions, e.g., for the camera: - You may see options like: - Always allow - Always ask - Don’t allow 6. Click **Confirm** to save your changes. **Note:** Changes made to these settings will apply to all devices connected to your Meta AI app. ## Switch release channel Release channels let testers choose between different versions of your integration. ### To switch release channel 1. Open the Meta AI App. 2. Go to the device menu and tap **Settings**. 3. Tap **Release Channel** to see available options. 4. Select your preferred channel. - If there are multiple channels, you can pick the one you want. - If only one is available, it will be selected by default. 5. Click **Confirm** to save your changes. ![switch release channel](/images/switch-release-channel.gif) Learn [How to disconnect apps from AI glasses](https://www.meta.com/en-gb/help/ai-glasses/836668612353969/). ### Access your Meta Wearables Device Access Toolkit information You can request a copy of your information related to Wearables Device Access Toolkit integrations. You will get a file containing your profile information and other data. To request your information, follow these steps: 1. Visit the [Download information from your managed Meta account](https://work.meta.com/help/836165424150596) help article. 2. Follow the instructions to request an export of your **Meta Wearables developer profile information**. ![Download your information.](/images/download-your-information.png) We will email you to acknowledge your request. You will get another email when your files are ready to download. ### Known issues ## Wearables Device Access Toolkit | Issue | Workaround | | --- | --- | | If there isn't an internet connection present, your app may fail to connect with the Wearables Developer Access Toolkit, and you may not be able to register your app in developer mode. | An internet connection is required for registration. | | Streams that are started with the glasses doffed are paused when they glasses are donned. | None at this time. You can unpause by tapping the side of your glasses. | | If the glasses' hinges are closed while streaming, the underlying service in the glasses may get stuck. Camera will stop working (including non Wearables Device Access Toolkit capture cases, like pressing capture button) until glasses are rebooted. | Restart the glasses with the power switch. | | **[iOS-only]** Meta Ray-Ban Display glasses don't play "Experience paused"/"Experience started" when pausing or resuming the session using captouch gestures. | This issue will be resolved in a future SDK release. | ## Wearables Developer Center | Issue | Workaround | | --- | --- | | Email addresses of members invited to a release channel must already be associated with a Meta account. | Verify anyone you invite to a release channel has set up a Meta account at [meta.ai](https://www.meta.ai/). | | Users logged into [developers.meta.com](https://developers.meta.com/) (Meta Horizon) may face an error with links from the Wearables Developer Center because it uses a different domain ([developer.meta.com](https://developer.meta.com/)). | Logout from [developers.meta.com](https://developers.meta.com/) before signing up for the Wearables Developer Center. | ### Version Dependencies ## Overview This page outlines the supported versions of the Meta AI app and glasses firmware for each release of the Meta Wearables Device Access Toolkit. ## 0.6.0 | App/Firmware | Support | | --- | --- | | Meta AI app (Android) | V254 | | Meta AI app (iOS) | V254 | | Ray-Ban Meta glasses | V22 | | Meta Ray-Ban Display glasses | V21 | | Oakley Meta HSTN glasses | V22 | | Oakley Meta Vanguard glasses | V22 | ## 0.5.0 | App/Firmware | Support | | --- | --- | | Meta AI app (Android) | V254 | | Meta AI app (iOS) | V254 | | Ray-Ban Meta glasses | V22 | | Meta Ray-Ban Display glasses | V21 | | Oakley Meta HSTN glasses | V22 | | Oakley Meta Vanguard glasses | V22 | ## 0.4.0 | App/Firmware | Support | | --- | --- | | Meta AI app (Android) | V254 | | Meta AI app (iOS) | V254 | | Ray-Ban Meta glasses | V20 | | Meta Ray-Ban Display glasses | V21 | | Oakley Meta HSTN glasses | V20 | | Oakley Meta Vanguard glasses | V22 | ## 0.3.0 | App/Firmware | Support | | --- | --- | | Meta AI app (Android) | V249 | | Meta AI app (iOS) | V249 | | Ray-Ban Meta glasses | V20 | | Oakley Meta HSTN glasses | V20 | ## Section 2: Android API Reference ### StreamConfiguration Configuration for a media streaming session with a Meta Wearables device. Defines the video quali... ### VideoFrame Represents a single frame of video data from a Meta Wearables device. Contains the raw video buff... ### DeviceSelectorBase Abstract base class for [DeviceSelector](com_meta_wearable_dat_core_selectors_deviceselector) imp... ### AutoDeviceSelector A device selector that automatically selects an optimal device from the provided device set. Uses... ### SpecificDeviceSelector A device selector that always selects a specific, predetermined device. Use this when you want to... ### BaseCapability Base class for capabilities that are attached to a [Session](com_meta_wearable_dat_core_session_s... ### DeviceSession Manages a session with Meta Wearables devices based on a provided device selector. Handles automa... ### Session Manages a session with a Meta Wearables device. Sessions are created via Wearables.createSession ... ### DatException Base exception class for the DAT (Device Access Toolkit) SDK. ### DatResult A specialized Result wrapper for DAT SDK operations that provides type-safe error handling while ... ### Device Contains metadata information about a Meta Wearables device. ### DeviceIdentifier A unique identifier for a Meta Wearables device. This identifier is used to distinguish between d... ### RegistrationState Represents the current state of user registration with the Meta Wearables platform. Each state ca... ### WearablesException Base exception class for the DAT (Device Access Toolkit) SDK. ### MockDeviceKitConfig Configuration for MockDeviceKit behavior. ### MockDeviceKit Main entry point for managing simulated Meta Wearables devices. ### StreamError (enum) Represents all possible stream error types that can occur during camera streaming operations. ### StreamSessionState (enum) Represents the current state of a media streaming session with a Meta Wearables device. ### DeviceSessionState (enum) Represents the current state of a Meta Wearables device session. ### SessionState (enum) Represents the current state of a device session in the Meta Wearables SDK. ### VideoQuality (enum) Defines the quality levels available for video streaming from Meta Wearables devices. Higher qual... ### DeviceCompatibility (enum) Indicates the compatibility status between AI glasses and the Wearables Device Access Toolkit. ### DeviceType (enum) Represents the types of Meta Wearables devices supported by the Wearables Device Access Toolkit. ### LinkState (enum) ### Permission (enum) Represents the types of permissions that can be requested from Meta Wearables devices. ### PermissionError (enum) Represents the specific types of errors that can occur during permission operations with Meta Wea... ### RegistrationError (enum) Enum representing errors that can occur during the Meta Wearables registration process. ### SessionError (enum) Enum representing errors that can occur during session lifecycle operations in the DAT SDK. ### WearablesError (enum) Enum representing errors that can occur in the Wearables Device Access Toolkit. ### CameraFacing (enum) Specifies which phone camera to use as the mock device camera source. ## Section 3: iOS Swift API Reference ### PhotoCaptureFormat (enum) Supported formats for capturing photos from Meta Wearables devices. ### PhotoData A photo captured from a Meta Wearables device. ### StreamingResolution (enum) Valid Live Streaming resolutions. We are using 9:16 aspect ratio. ### StreamSession A class for managing media streaming sessions with Meta Wearables devices. Handles video streamin... ### StreamSessionConfig Configuration for a media streaming session with a Meta Wearables device. Defines video codec, re... ### StreamSessionError (enum) Errors that can occur during streaming sessions. ### StreamSessionState (enum) Represents the current state of a media streaming session with a Meta Wearables device. ### VideoCodec (enum) Specifies the video codec to use for streaming. ### VideoFrame Represents a single frame of video data from a Meta Wearables device. Contains the raw video samp... ### VideoFrameSize Represents the width and height of a video frame in pixels. ### Announcer A protocol for objects that can announce events to registered listeners. ### AnyListenerToken A token that can be used to cancel a listener subscription. When the token is no longer reference... ### AutoDeviceSelector A device selector that automatically selects the best available device. Selects the first connect... ### Capability A protocol for capabilities that can be attached to a `DeviceSession`. ### CapabilityState (enum) Represents the state of a capability attached to a `DeviceSession`. ### Compatibility (enum) Indicates the compatibility status between AI glasses and the Wearables Device Access Toolkit. ### Device AI glasses accessible through the Wearables Device Access Toolkit. ### DeviceSelector Protocol for selecting which device should be used for operations. Device selectors determine whi... ### DeviceSessionState (enum) Represents the current state of a `DeviceSession`. ### DeviceSessionError (enum) Errors that can occur during `DeviceSession` operations. ### DeviceStateSession Manages a session for monitoring device state changes. ### DeviceType (enum) Represents the types of Meta Wearables devices supported by the Wearables Device Access Toolkit. ### LinkState (enum) Represents the connection state between a device and the Wearables Device Access Toolkit. ### Mutex ### Permission (enum) Represents the types of permissions that can be requested from AI glasses. ### PermissionError (enum) Errors that can occur during permission requests. ### PermissionStatus (enum) Represents the status of a permission request. ### RegistrationError (enum) Error conditions that can occur during the registration process. ### RegistrationState (enum) Represents the current state of user registration with the Meta Wearables platform. ### SessionState (enum) Represents the current state of a device session in the Wearables Device Access Toolkit. ### SpecificDeviceSelector A device selector that always selects a specific, predetermined device. Use this when you want to... ### UnregistrationError (enum) Error conditions that can occur during the unregistration process. ### Wearables (enum) The entry point for configuring and accessing the Wearables Device Access Toolkit. ### WearablesHandleURLError (enum) Errors that can occur during URL handling. ### WearablesError (enum) Errors that can occur during Device Access Toolkit configuration. ### WearablesInterface The primary interface for Wearables Device Access Toolkit. ### CameraFacing (enum) The camera to use for live streaming from the phone. ### MockCameraKit A suite for mocking camera functionality. ### MockDevice ### MockDeviceKit (enum) The entry-point to the MockDeviceKit for managing simulated Meta Wearables devices. Use this in t... ### MockDeviceKitConfig Configuration options for MockDeviceKit. ### MockDeviceKitInterface Interface for managing mock Meta Wearables devices for testing and development. ### MockDisplaylessGlasses Protocol for simulating displayless smart glasses behavior in testing and development. Provides f... ### MockDisplaylessGlassesServices Container for accessing mock device service kits. ### MockPermissions Interface for configuring mock permission behavior during testing. ### MockRaybanMeta Protocol for simulating Ray-Ban Meta smart glasses behavior in testing and development. Inherits ...