Skip to content

UISession

The UISession class provides methods to interact with active application sessions on the current PC. Remember, each Application Center instance is a separate session. Specifically, it allows communication with these sessions by sending messages. When a message is sent, it triggers a response in the active application through the StartApp.onMessage(msg) callback. You can list other session objects via ui.sessions.

Methods:

  • sendMessage(msg: string)
    Send a message to the active application sessions on this PC. This communication is designed to trigger the StartApp.onMessage(msg) method in the target application, which can then handle the message appropriately.
  • msg: The string message to be sent to the active application session.
Example
// Send a message to the active application session`  
ui.sessions.forEach( session => session.sendMessage("Hello! Do something") );