Powered by Algolia

onButtonState handler

Responsible for handling the Alan button state change events.

When the user launches an app with the Alan button, Alan connects to the project in the Alan Cloud, and the Alan button transitions through several states:

  • CONNECTING: Alan is connecting to your voice assistant project in the Alan Cloud
  • ONLINE: a connection to the project is established
  • LISTEN: Alan is listening to the user input
  • PROCESS: Alan is processing the user input
  • REPLY: Alan is replying to the user
  • OFFLINE: no connection to the Internet; the connection to the Alan Studio project cannot be established

If you need to perform activities in the app while the Alan button is in a specific state, you can use the ‘onButtonState’ handler to listen to the Alan button state changes.