- Try it:
git clone https://github.com/Offline-Protocol/offline-app-examples, then run an app on two phones as its README describes. - With a coding agent: connect local MCP and ask the agent to build.
- By hand: follow the steps below.
appId string you choose (here 'field-handoff'), keep the app in the foreground, and communicate over Bluetooth LE. The mesh app identifier is not the portal App ID. No developer-portal account, key or internet relay is required.
1. Install and grant permissions
Follow React Native installation to install@offline-protocol/mesh-sdk@0.31.0, link the native module and grant Bluetooth permissions. Turn Bluetooth on and place the phones nearby.
Use one protocol instance per app process. Register listeners before starting it.
2. Start and discover a peer
startMesh() on both phones after permissions are granted. On the sending phone, select the address reported by neighbor_discovered, then call sendUpdate(peerAddress) from your UI. The SDK queues outbound messages while establishing the encrypted session. Existing sessions survive stop/start, so do not require a fresh secure_session_established event to enable sending.
A recipient is the discovered off1… address. Do not substitute a profile name, username, mesh app identifier, App ID or API key.
3. Check the result
The receiving phone prints the inspection JSON. The sender reportsmessage_delivered for the returned message ID. The receiving core sends its acknowledgment before emitting message_received and does not persist inbound content. This logging-only example is not a durable handoff. Register a handler that writes incoming records to your application’s durable storage before startup; application acceptance is a separate step.
Disable cellular data and disconnect Wi-Fi on both phones while keeping Bluetooth enabled. Send another update. The same BLE workflow should complete without a backend connection. Record the observed transport and result on your hardware.
If discovery or delivery fails, follow Troubleshooting. Do not call stopMesh() immediately after sending: keep the protocol running to receive the acknowledgment.
stopMesh() stops the protocol without removing its listeners, so the same instance can start again. After destroyMesh(), construct a new OfflineProtocol and re-register listeners.
Continue
Local handoff
Add durable records and an application receipt.
Synchronize a checklist
Use replicated documents for shared state.

