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.
Paths and class names below match the Espressif RainMaker Home app. Your module names may differ; keep the same responsibilities at each layer.
| Layer | Dependency / package | Role |
|---|---|---|
| MatterSupport UI | MatterSupport (MatterAddDeviceRequest, MatterAddDeviceExtensionRequestHandler) | System commissioning flow, Wi‑Fi/Thread selection |
| Matter stack | Matter (MTRDeviceController, MTRDeviceControllerFactory, MTROperationalCertificateIssuer) | PASE, device commission, NOC install, clusters |
| RN bridge | ESPMatterModule + RCTEventEmitter | JS calls, events, cloud round-trips via SDK |
| App Group | ESPLocalStorage / ESPMatterExtensionEcoInfo | Host app ↔ Matter Extension shared state |
Key native files: ESPMatterModule.swift, RequestHandler.swift, ESPMatterEcosystemInfo.swift, ESPMatterUtilityModule.swift, MTRCSRKeys.m
RN entry: ESPMatterCommissioningAdaptor → NativeModules.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.
| Phase | Doc | Summary |
|---|---|---|
| 0 | Screen boot and event listener | Register listener, start fabric prep |
| 1 | Fabric bootstrap | Convert home, issue user NOC, Keychain |
| 2 | Hand off to native | startEcosystemCommissioning → MatterSupport |
| 3 | Apple MatterSupport UI | BLE/Wi‑Fi/Thread discovery, device name |
| 4 | RainMaker fabric init | MTRDeviceController + user NOC from Keychain |
| 5 | PASE and commissioning session | PASE + commissionNode |
| 6 | Device node NOC | Main RN runtime + cloud node cert |
| 7 | Post-commission and cloud confirm | Metadata read, SDK confirm |
| 8 | UI success | Terminal success → toast, sync, home |
Start at Phase 0.
For shared terms (PASE, NOC, two CSRs), see Native Bridge.