Skip to content
This repository was archived by the owner on May 2, 2025. It is now read-only.
This repository was archived by the owner on May 2, 2025. It is now read-only.

Getting onboarding payload after QR code is scanned #222

@remziyey

Description

@remziyey

Hi all,

I want to get onboarding payload (starts with MT) of a matter device after its QR code scanned (or setup code is entered) and commissioning is successful (to pass it to custom tv hub).
commissionedDeviceDescriptor doesn't contain onboarding payload and I tried to get it from intent like this:

val commissionDeviceLauncher =
    rememberLauncherForActivityResult(
      contract = ActivityResultContracts.StartIntentSenderForResult()
    ) { result ->
      // Commission Device Step 5.
      // The Commission Device activity in GPS (step 4) has completed.
      val resultCode = result.resultCode
      if (resultCode == Activity.RESULT_OK) {
        Timber.d("CommissionDevice: Success")

        val payload = result.data?.getStringExtra(Matter.EXTRA_ONBOARDING_PAYLOAD)
        Timber.i("Payload $payload")

        // We let the ViewModel know that GPS commissioning has completed successfully.
        // The ViewModel knows that we still need to capture the device name and will\
        // update UI state to trigger the NewDeviceAlertDialog.
        homeViewModel.gpsCommissioningDeviceSucceeded(result)
      } else {
        homeViewModel.commissionDeviceFailed(resultCode)
      }
    }

but intent doesn't have an EXTRA_ONBOARDING_PAYLOAD extra.
I tried these with both with matter virtual device (macOS app) and real matter device.

I am not sure if I am missing something, any help would be appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions