0

The GPS Matter Commissioning intent filter looks like this, it does not use a URI scheme. If I try adding a URI GPS can't find my app any more.

            <intent-filter>
                <action android:name="com.google.android.gms.home.matter.ACTION_COMMISSION_DEVICE"/>
                <category android:name="android.intent.category.DEFAULT"/>
            </intent-filter>

So how do I use this intent to navigate in Jetpack compose? This deeplink does not trigger.

fun NavGraphBuilder.lowpanGraph(appState: LowpanAppState) {

    composable(route = "$DEVICES_SCREEN",
        deepLinks = listOf(navDeepLink { action = "com.google.android.gms.home.matter.ACTION_COMMISSION_DEVICE"})
    ) {
        DevicesScreen(openScreen = { route -> appState.navigate(route) })
    }

Jon Smirl
  • 349
  • 2
  • 10
  • 1
    That's exactly what the `action` field is for, so the code you've written is what would be expected. What does your app do instead? Do you use a `launchMode` on your activity in the AndroidManifest.xml (you shouldn't be, FWIW)? – ianhanniballake Jan 23 '23 at 18:40
  • Thanks, that was the clue I needed. I had android:launchMode="singleTop" in the manifest because I had previously tried getting this to work using OnNewIntent(). Remove android:launchMode="singleTop" and this code will work. – Jon Smirl Jan 23 '23 at 18:50

1 Answers1

1

The answer here: make sure you don't have a launchMode set in your manifest file.

Jon Smirl
  • 349
  • 2
  • 10