...
Controls are events that can be triggered through the Gumband UI. Common use cases for controls are rebooting an application that runs an exhibit or triggering some sort of test content or animation to help with debugging. Like statuses, controls are unique per exhibit and must be configured through the manifest. For example:
Code Block | ||
---|---|---|
| ||
{ "manifest": { "statuses": [], "controls": [ { "id": "reload-frontend", "type": "Single", "display": "Reload Frontend", "order": 0 }, { "id": "toggle-game-mode", "type": "Single", "display": "Toggle Game Mode", "order": 1 } ], "settings": [] } } |
...
Controls are one-way communications from the Gumband cloud to the exhibit. You can listen for a control trigger through the Sockets.CONTROL_RECEIVED
event listener callback on the SDK:
Code Block | ||
---|---|---|
| ||
this.gumbandSDK.on(Sockets.CONTROL_RECEIVED, async (payload) => { console.log(`Control triggered: ${payload.id}`); if(payload.id === "toggle-game-mode") { this.toggleGameMode(); } else if (payload.id === "reload-frontend") { this.reloadFrontend(); } }); |