Skip to content
All work

IoT

Restoring Sensor Pairing on the Newest iPhones With a Native Bridge

Prepared by Jebin Benny

A recent iPhone photographed close up against a dark background.

Our client is a North American home-telematics provider whose connected sensors are distributed to policyholders by property insurers. iLeaf builds and maintains their iOS and Android applications.

For a connected-property product, onboarding is not a step before the product. It is the product's first and most fragile moment: a policyholder who cannot pair the hub does not have a leak sensor, they have a box. So when pairing broke on one platform, it broke the thing the programme exists to do.

The Challenge

The mobile application paired the sensor hub successfully on Android. On iOS, on the latest devices, it did not connect at all.

The asymmetry was the useful part of the report. A hub that failed everywhere would point at the hub, the firmware or the network. One that worked on Android and failed only on recent iPhones pointed somewhere much narrower — and, importantly, at something that would get worse rather than better, since the affected devices were the ones customers were actively upgrading to.

The Investigation

We worked it from both ends, the application and the communication layer:

  • Traced the exchange between the hub and the application to see how far pairing actually got.
  • Reviewed the existing iOS implementation against the working Android path.
  • Read the connectivity code itself rather than assuming the bug was above it.
  • Examined the third-party library handling hub communication.
  • Compared platform behaviour directly, the same hub against both apps.
  • Tested on the latest iOS devices specifically, rather than on whatever was in the drawer.

That last point did most of the work. The issue reproduced on current hardware and not on older devices, which confirmed this was not general hub connectivity failing but something specific to newer iOS behaviour.

Root Cause

The third-party library that handled hub communication did not correctly handle behaviour required by the latest iOS devices.

The library offered no fix. That is worth stating plainly, because it is the constraint that shaped everything after it: the defect was real, it was in someone else's code, and there was no version to upgrade to.

That leaves three options. Wait for the vendor, on their schedule, while customers with new iPhones cannot onboard. Replace the library, which means reimplementing a working integration and re-testing every device already in the field. Or add the missing behaviour ourselves, at the layer we control.

What We Built

We created a native bridge in the iOS application and implemented the required iOS-specific behaviour natively through it.

The library kept doing everything it still did correctly. The bridge supplied only the part it got wrong on current devices, in native iOS code, at the application layer — an addition rather than a replacement.

This mattered for four reasons:

  • The existing integration stayed. No rewrite of a communication path that worked on every other device.
  • The fix did not depend on anyone else. No waiting on a vendor release with no date attached.
  • The scope stayed small. Native code was written for the specific behaviour that was broken, not for hub communication in general.
  • It is reversible. If the library ships a proper fix, the bridge is a contained thing to remove.

The Result

Sensor hubs paired successfully on the latest iOS devices.

The platform-specific failure was resolved while the existing communication implementation continued in service, and policyholders on current iPhones could onboard their sensors again — which, for a product whose value is noticing a leak at two in the morning, is the whole of the point.

The Part Worth Taking Away

Two things, and the second is the one that generalises.

A third-party communication library is a dependency on someone else's OS-upgrade schedule. Every September it is worth testing your integrations against new devices before your customers do it for you. This failure was found because someone tested on current hardware; it would otherwise have been found by a policyholder unboxing a sensor.

When a library cannot be fixed and cannot be replaced, a native bridge is a legitimate third answer. It is not the elegant one, and it should be documented as what it is — a deliberate patch over a known vendor defect, with a note about when it can come out. But a contained piece of native code that restores correct behaviour is very often better than a rewrite you did not need or a wait you cannot justify to the people who bought the thing.

Take this case study with you

Download a PDF of Restoring Sensor Pairing on the Newest iPhones With a Native Bridge. It is watermarked with your details, so please treat it as confidential.

So a solutions lead can follow up if you want them to.

Have a system that needs to do this?

500+ systems shipped since 2011, and we still maintain most of them. Tell us what you are trying to move.