- the scan, which lists only glasses that can pair now, and a rescan so the list never goes stale;
- adopting glasses this phone already bonded, without asking for pairing mode;
- connecting, waiting for the glasses to boot and become ready;
- Pair Audio when audio needs the person, and cancelling it, which unpairs the glasses;
- Forget the old pairing when iOS holds a stale Bluetooth pairing;
- success and failure.
scan(),
connect() and pairing events in application code.
Use The Exact Mentra App Pairing Pages
This is the simplest integration.MentraLivePairingFlow renders the same
pages as the Mentra App: power on, scan, connecting, Pair Audio, Forget the old
pairing, success and failure.
Install matching Mentra Engine and Bluetooth SDK releases:
initialPage is where the flow starts:
MentraLivePairingFlow handles Android Back itself, as each page’s own back
action. It initializes only the Engine projections pairing needs. If your app
already called engine.start(), pass initializeRuntime={false}.
A successful pairing leaves the glasses connected. Check for the matching glasses software next: see
Update Mentra Live.
Theme, Translate And Permissions
The stock pages take your colors, copy and permission prompts. This flow uses your colors and asks for Android’s Bluetooth permissions before the scan:Replace Some Pages
To keep most stock pages and replace a few, make the controller withuseMentraLivePairing and render MentraLivePairingPages with your pages.
Each page receives {state, controller} for that page:
MentraLivePairingPages takes the same theme, translate, images and other
page props as the stock flow, and the options above go to
useMentraLivePairing. Unlike MentraLivePairingFlow, it does not handle
Android Back: wire your navigator’s back gesture to controller.back().
Build Every Page Yourself
UseuseMentraLivePairing alone when your app needs its own components,
layout and navigation for every page. The hook exposes the current page and
the actions that page offers; the Engine keeps all pairing sequencing.
The Bluetooth SDK Starter Kit
does this in its
custom pairing folder.
Its flow makes the controller, maps the state to its own presentation, and
handles Android Back and the Pair Audio cancel itself:
pairingPresentation turns each page’s state into a title, message,
glasses rows and buttons. The scan page, for example:
@mentra/bluetooth-sdk/internal, Engine
stores, or Engine services.
Pages And Actions
controller.state.page is one of these, with the fields and actions it offers:
Each scan row is a
MentraLivePairingGlasses: id, label (the Bluetooth
name without its model prefix, for example E511, which matches the code the
glasses speak), and the SDK device. The list holds only glasses that can pair
now: in pairing mode, or older firmware that always pairs. Glasses leave it when
their window closes. pair_audio and success have no back(): give them
their own buttons.
Native Android And iOS Apps
Mentra Engine’s pairing flow is currently a React Native integration. Native Android and iOS apps build pairing on the lower-level pairing state and events in the API Reference, including the pairing window,pairingState, and the Pair Again state.
