← Back to portfolio

Case study / 05 · Connected hardware · BLE

Running a Bluetooth device from a React Native app, with reconnects above 99%

At Babyation I led five developers on the React Native app people use to operate a Bluetooth-connected hardware device. The hard part was not the first connection. It was keeping the link alive in real life.

Context

The device is controlled from the phone: pair it, start and manage a session remotely, and see guidance tailored to the person using it. People also use more than one phone or tablet, so the data had to follow them.

Problem

The link kept dropping when the app went to the background. Re-subscription to the device was tied to a component mounting, so when the UI went away, so did the subscription, and the hardware and the app quietly fell out of step.

Approach

Result

What I took from it

Bind a hardware lifecycle to the hardware's own state. Anything tied to the UI lifecycle will break the first time someone locks their phone.