Shortcut suggestion from In-App Promo SDK is blank and produces an error

72 Views Asked by At

I'm trying to use the "In-App Promo SDK" to suggest a shortcut to the user using createShortcutSuggestionIntent.

I have submitted my signed app bundle to the google play console under internal testing.

I have created a preview using the App Actions Test Tool. I can successfully use the App Actions Test Tool to run an app action with actions.intent.OPEN_APP_FEATURE, and it opens my app at the desired activity. If I manually add the shortcut to assistant it works as desired and I can open specific features in my app using voice commands. createShortcutSettingsIntent works as expected.

The only problem is the in-app shortcut suggestion not working.

val shortcutsClient = AssistantShortcutSuggestionsClient.builder()
    .setContext(this@MainActivity)
    .setVerifyIntents(true)
    .build()

val appShortcutIntent = AppShortcutIntent.builder()
    .setIntentName("actions.intent.OPEN_APP_FEATURE")
    .setPackageName("com.mypackage")
    .setIntentParamName("feature")
    .setIntentParamValue("test")
    .build()

if (shortcutsClient.lookupShortcut(appShortcutIntent).await().isShortcutPresent) {
    return
}

val orderShortcut = AppShortcutSuggestion.builder()
    .setAppShortcutIntent(appShortcutIntent)
    .setCommand("my shortcut phrase")
    .build()

val intent = shortcutsClient.createShortcutSuggestionIntent(orderShortcut).await()
application.startActivity(intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK))

The shortcut suggestion activity opens for a brief moment but doesn't render any text. Here is the error:

Failed to get shortcut page response
com.google.android.apps.gsa.shared.speech.a.n: errorCode: -83902, engine: 2
    at com.google.android.apps.gsa.s3.x.b(PG:1)
    at com.google.android.apps.gsa.staticplugins.cs.a.f.d(PG:2)
    at com.google.android.apps.gsa.s3.r.f(PG:7)
    at com.google.android.apps.gsa.s3.r.c(PG:32)
    at com.google.android.apps.gsa.s3.q.run(PG:1)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:463)
    at java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at com.google.android.apps.gsa.shared.util.c.a.e.run(PG:2)
    at com.google.android.apps.gsa.shared.util.c.a.bh.run(PG:1)
    at com.google.android.apps.gsa.shared.util.c.a.bh.run(PG:1)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
    at java.lang.Thread.run(Thread.java:1012)
    at com.google.android.apps.gsa.shared.util.c.a.l.run(PG:5)

blank suggestion popup

0

There are 0 best solutions below