Phase 2 — Hand off to native
Layer: JS → Swift
Call chain
Native (ESPMatterModule.startEcosystemCommissioning)
- Stores
currentFabricInfoand promise resolve/reject blocks. - Calls
startAppleFabricCommissioning(qrData:fabric:)onmatterQueue. - Does not resolve the promise until Apple + custom commissioning complete or fail.
ESPMatterCommissioningAdaptor
Registers NativeEventEmitter listener before calling native. Forwards:
NODE_NOC_REQUEST→ SDKissueNodeNoChandlerCOMMISSIONING_CONFIRMATION_REQUEST→ SDKconfirmMatterNodeCommissioninghandler
What could go wrong
Missing fabricId, empty QR payload, or iOS < 16.4 → promise rejects with COMMISSIONING_FAILED / APPLE_COMMISSIONING_FAILED and emits COMMISSIONING_ERROR.