Getting started with AirConsol...
API Methods Overwiew
2min
message(device_id, data) -> onMessage(device_id, data)
Send a message from the screen to a specific controller:

The screen always has the device_id = 0. All other device_ids should be seen as random.
We recommend to use the constant AirConsole.SCREEN instead of 0
Send a message from a controller to the screen:

broadcast(data) -> onMessage(device_id, data)
Send a message from the screen to all controllers:

setCustomDeviceStateProperty(key, value) -> onCustomDeviceStateChange(device_id, data)
A device sets it's custom data property and triggers theonCustomDeviceStateChange()method on the other devices.

setActivePlayers(max_players)
The screen sets maximum two devices as active players and triggers theonActivePlayersChange()method on the first two devices.

Updated 26 Sep 2024
Did this page help you?