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:

Document image

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:

Document image


broadcast(data) -> onMessage(device_id, data)

Send a message from the screen to all controllers:

Document image


setCustomDeviceStateProperty(key, value) -> onCustomDeviceStateChange(device_id, data)

A device sets it's custom data property and triggers theonCustomDeviceStateChange()method on the other devices.

Document image


setActivePlayers(max_players)

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

Document image