getState

Used to get the state of the hosting entity (a page where an app is embedded or the widget containing an iframe)

Syntax

messageHandler.getState().then(function(state){//do something});
  
  // or
  
let status=await messageHandler.getState();

The State object

  1. hostName (String): The current host name
  2. hostType (String): The type of the host - page | widget
  3. state (String): The logical state of the host - ready | loading | loaded
  4. staff : The staff object
  5. accountUid (String): The unique identifier of the account
  6. view (String): Is the page in a "team" mode or in a "my view" mode - team | my_view
{
  "hostName": "home",
  "hostType: "widget"
  "staff": <staff>,
  "accountUid": "abc123"
  "state": "Ready"
  "view": "team"
}