Nach der Freigabe der App für die Produktion können andere Benutzer diese dynamischen Verknüpfungen jedoch nicht mehr sehen Liste der Google Assistant-Verknüpfungen. Die Verknüpfungen sind nur auf meinem Entwicklungsgerät sichtbar, das über dasselbe Google-Konto verfügt, das ich während der Entwicklung verwendet habe. Ich möchte, dass diese dynamische Funktion für alle meine Benutzer sichtbar ist.
Code: Select all
intent.setAction(Intent.ACTION_VIEW);
intent.putExtra(GET_THING_KEY, "blue"); // Add extras for the intent
// Build the shortcut
ShortcutInfoCompat shortcut = new ShortcutInfoCompat.Builder(context, "dynamic_change_color")
.setShortLabel("Change Color to Blue")
.setLongLabel("Change the light color to blue")
.setIcon(IconCompat.createWithResource(context, R.drawable.aav_profile_icon))
.addCapabilityBinding(
"actions.intent.GET_THING", "thing.name", listOf("blue"))
.setIntent(intent) // Associate the shortcut with the intent
.setLongLived(false)
.build();
// Push the shortcut
ShortcutManagerCompat.pushDynamicShortcut(context, shortcut);