Skip to main content

iOS Native Bridge

How Matter commissioning runs on iOS: Apple MatterSupport for the system UI, Matter framework (MTRDeviceController) for fabric operations, bridged to React Native via ESPMatterModule.

In one line: MatterSupport handles discovery and network setup; MTRDeviceController runs PASE and commissioning; the main React Native runtime calls RainMaker cloud APIs while the MatterSupport UI may be in the foreground.

Reference implementation

Paths and class names below match the Espressif RainMaker Home app. Your module names may differ; keep the same responsibilities at each layer.

LayerDependency / packageRole
MatterSupport UIMatterSupport (MatterAddDeviceRequest, MatterAddDeviceExtensionRequestHandler)System commissioning flow, Wi‑Fi/Thread selection
Matter stackMatter (MTRDeviceController, MTRDeviceControllerFactory, MTROperationalCertificateIssuer)PASE, device commission, NOC install, clusters
RN bridgeESPMatterModule + RCTEventEmitterJS calls, events, cloud round-trips via SDK
App GroupESPLocalStorage / ESPMatterExtensionEcoInfoHost app ↔ Matter Extension shared state

Key native files: ESPMatterModule.swift, RequestHandler.swift, ESPMatterEcosystemInfo.swift, ESPMatterUtilityModule.swift, MTRCSRKeys.m

RN entry: ESPMatterCommissioningAdaptorNativeModules.ESPMatterModule
Feature UI: commissioning hook listening to MatterCommissioningEvent

Requirements: iOS 16.4+, entitlements com.apple.developer.matter.allow-setup-payload and App Group (APP_GROUP_ID), Matter Extension target with com.apple.matter.support.extension.device-setup.


Phases (0–8)

Follow these in order. Each phase has its own diagram and failure notes.

PhaseDocSummary
0Screen boot and event listenerRegister listener, start fabric prep
1Fabric bootstrapConvert home, issue user NOC, Keychain
2Hand off to nativestartEcosystemCommissioning → MatterSupport
3Apple MatterSupport UIBLE/Wi‑Fi/Thread discovery, device name
4RainMaker fabric initMTRDeviceController + user NOC from Keychain
5PASE and commissioning sessionPASE + commissionNode
6Device node NOCMain RN runtime + cloud node cert
7Post-commission and cloud confirmMetadata read, SDK confirm
8UI successTerminal success → toast, sync, home

Start at Phase 0.

For shared terms (PASE, NOC, two CSRs), see Native Bridge.


On this page