LogoLogo
  • Overview
  • Voice Assistants as a Service
  • Voice Assistant Concepts
  • Voice Assistant Components
  • Voice Assistant Types
  • Platform & Languages Supported
  • Getting Started
    • Integrating Slang CONVA into Retail e-Commerce Apps
      • Setting up Slang CONVA
      • Customizing the Assistant
      • Code Integration
        • CONVA Search
          • Advanced Topics
        • CONVA Plus
          • Supported User Journeys
            • Search
            • Order Management
            • Checkout
            • Offer Management
            • Navigation
    • Integrating Slang CONVA into Travel e-Commerce Apps
      • Setting up Slang CONVA
      • Code Integration - Basic Steps
      • Supported User Journeys
        • Search
        • Navigation
  • Advanced Topics
    • Asynchronous Action Handling
    • Changing the Assistant behavior at runtime
      • Launching the Assistant Programmatically
      • Changing the language of the Assistant
      • Accessing and Setting User Journey Context
    • Advanced Assistant Customizations
      • Customizing the Visual nature of the Assistant
      • Customizing the conversational aspects of the Assistant
      • Training the Assistant to recognize additional data
        • Customizing Retail Subdomain Data
  • Sample Apps
    • Slang Playground App
    • Slang Retail e-Commerce App
Powered by GitBook
On this page
  • The onNavigation callback
  • Sample Utterances that could trigger Navigation
  • NavigationInfo Parameter
  • Supported AppStates
  • Supported Conditions
  • Assistant Prompts

Was this helpful?

  1. Getting Started
  2. Integrating Slang CONVA into Travel e-Commerce Apps
  3. Supported User Journeys

Navigation

Details about the Navigation user journey

The onNavigation callback

When the Assistant detects that the user is trying to navigate to various parts of the app, it invokes the callback associated with the Navigation user journey. The callback looks like this:

NavigationUserJourney.AppState onNavigation(NavigationInfo navigationInfo, NavigationUserJourney userJourney);
onNavigation: async (navigationInfo, navigationUserJourney)
onNavigation: async (navigationInfo, navigationUserJourney)

When this callback is invoked, the app is expected to:

  1. Use the NavigationInfo parameter to examine the target of the user's navigation

  2. Open the corresponding page/Activity using the target field

  3. Finally, return the AppState and Condition that the app transitioned into.

For example, for a given onNavigation callback invocation, if the user asked for viewing the cart and if the app can navigate to that page successfully, it sets the success condition and returns the NAVIGATION app state.

public NavigationUserJourney.AppState onNavigation(NavigationInfo navigationInfo, NavigationUserJourney userJourney) {
   switch (navigationInfo.getTarget()) {
      case "cart": 
         // Goto cart
         // ...
         userJourney.setNavigationSuccess();
         return NavigationUserJourney.AppState.NAVIGATION;
    
      // ...     
   }
}
onNavigation: async (navigationInfo, navigationUserJourney) => {
  switch (navigationInfo.getTarget()) {
      case "cart": 
         // Goto cart
         // ...
         userJourney.setNavigationSuccess();
         return NavigationUserJourney.AppState.NAVIGATION;
    
      // ...     
   }
},
onNavigation: async (navigationInfo, navigationUserJourney) => {
  switch (navigationInfo.target) {
      case "cart": 
         // Goto cart
         // ...
         navigationUserJourney.setNavigationSuccess();
         return NavigationUserJourney.AppStates.NAVIGATION;
    
      // ...     
   }
},

Sample Utterances that could trigger Navigation

The following are some examples of commands that could trigger this journey

  • "go to my bookings"

  • "take me home"

NavigationInfo Parameter

The parameterNavigationInfo contains the breakdown of the original navigation request. It has the following structure:

Class NavigationInfo {
	String getTarget(); // Target to which app has been asked to navigate
}

// Possible target values
"back", "home", "bookings", "orders"
NavigationInfo : { target:  <target> }

// Possible target values
"back", "home", "pharmacy", "grocery", "basket", "order"

Supported AppStates

The following AppStates are supported.

  • NAVIGATION_COMPLETE : To be returned when the app handles the navigation request

  • UNSUPPORTED : To be returned when the app is not ready to handle navigation yet. The Assistant will speak out an appropriate prompt to the user.

The Slang Retail Assistant provides a special AppState 'WAITING' (WaitingAppState) that is common across all UserJourney types for completing asynchronous operations within the callback. Refer to the Asynchronous Action Handling section for details of how to deal with asynchronous operations.

Supported Conditions

The following Conditions are supported for each of the AppStates supported by the Assistant

App State

App State Condition

Description

NAVIGATION_COMPLETE

  • setSuccess()

  • setNeedTarget()

  • setFailure()

  • The navigation was successful

  • The navigation target is not valid

  • There was a failure while navigating

Assistant Prompts

Based on the App State and the Condition that was set, the Assistant will speak out an appropriate message to the user. You can examine the default set of prompts configured for the Assistant through the Console and also customize it to your needs. Refer to the Customizing the Assistant section for details.

PreviousSearchNextAsynchronous Action Handling

Last updated 3 years ago

Was this helpful?