Skip to main content

Phase 2 — Hand off to native

Layer: JS → Kotlin

Call chain

Native (ESPMatterModule)

  1. storeFabricDetails(fabricDetails) — Maps JS fabric map into FabricInfo and calls FabricSessionManager.setCurrentFabric(...) (groupId, fabricId, rootCa, ipk, userNoc, CATs, matterUserId, …).
  2. Route by BuildConfig.MATTER_COMMISSIONING_METHOD (Gradle MATTER_COMMISSIONING_METHOD, default ChipTool):
    • ChipToolstartChipToolCommissioning(onboardingPayload):
      • Intent → ChipToolCommissioningActivity with EXTRA_ONBOARDING_PAYLOAD = QR / manual pairing string.
      • Resolves promise: "ChipTool commissioning activity started".
    • GooglePlayServicesstartGooglePlayServicesCommissioningMatterCommissioningActivity (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.

On this page