Phase 2 — Hand off to native
Layer: JS → Kotlin
Call chain
Native (ESPMatterModule)
storeFabricDetails(fabricDetails)— Maps JS fabric map intoFabricInfoand callsFabricSessionManager.setCurrentFabric(...)(groupId,fabricId,rootCa,ipk,userNoc, CATs,matterUserId, …).- Route by
BuildConfig.MATTER_COMMISSIONING_METHOD(GradleMATTER_COMMISSIONING_METHOD, defaultChipTool):ChipTool—startChipToolCommissioning(onboardingPayload):- Intent →
ChipToolCommissioningActivitywithEXTRA_ONBOARDING_PAYLOAD= QR / manual pairing string. - Resolves promise:
"ChipTool commissioning activity started".
- Intent →
GooglePlayServices—startGooglePlayServicesCommissioning→MatterCommissioningActivity(legacy; not covered in phases 3–4).
Fabric details are persisted before the activity starts so ChipToolCommissioningActivity can construct ChipClient immediately.
React Native method signature
@ReactMethod
fun startEcosystemCommissioning(
onboardingPayload: String,
fabricDetails: ReadableMap,
promise: Promise
)
What could go wrong
Activity fails to start → promise rejects ACTIVITY_START_ERROR or COMMISSIONING_ERROR; ESPMatterModule may also emit MatterCommissioningEvent with eventType: COMMISSIONING_ERROR. Invalid or empty fabric map → ChipTool activity fails fast with missing-fabric error.