Listen to Broadcast

API 3.0

Touch Portal will send messages to the plug-in at certain events. Currently the only message that is broadcast is the page change event. You can use this broadcast for example to resend states whenever a page is loaded. This will allow the user to get the latest states just as a page is loaded. Here is an example of the message received:

{
  "type":"broadcast",
  "event":"pageChange",
  "pageName":"Media Control Page"
}
Key Type Req. API Description
type Text yes 3.0 The "broadcast" corresponts to a message type that is send from Touch Portal to all plug-ins. This is information non specific to your plug-in.
event Text yes 3.0 The type of broadcast event that is triggered. Currently only the "pageChange" is supported.
pageName Text No 3.0 The name of the page navigated to. The value will be send only when the broadcast is of the type "pageChange".
previousPageName Text No 8.0 The name of the page navigated from. The value will be send only when the broadcast is of the type "pageChange".
deviceIp Text No 8.0 The device ip of the device navigating pages. The value will be send only when the broadcast is of the type "pageChange".
deviceName Text No 8.0 The device name of the device navigating pages. The value will be send only when the broadcast is of the type "pageChange".
deviceId Text No 9.0 The device id (set for multiple devices upgrade) of the device navigating pages. The value will be send only when the broadcast is of the type "pageChange".