↳ Persistent Data

AirConsole

new AirConsole(opts) → {AirConsoleObject}

Your gateway object to AirConsole. There are getter and setter functions for all properties. Do not access properties of this object directly.
Parameters:
Name Type Description
opts AirConsole~Config Constructor config, see bellow.
Source:
Returns:
The AirConsole object.
Type
AirConsoleObject

Methods

(abstract) onPersistentDataLoaded(data)

Gets called when persistent data was loaded from requestPersistentData().
Parameters:
Name Type Description
data Object An object mapping uids to all key value pairs.
Source:

(abstract) onPersistentDataStored(uid)

Gets called when persistent data was stored from storePersistentData().
Parameters:
Name Type Description
uid String The uid for which the data was stored.
Source:

requestPersistentData(uids)

Requests persistent data from the servers.
Parameters:
Name Type Description
uids Array.<String> The uids for which you would like to request the persistent data. For controllers, the default is the uid of this device. Screens must provide a valid array of uids.
Version:
  • 1.9.0 - uids is no longer optional for requests from the screen
Source:

storePersistentData(key, value, uid)

Stores a key-value pair persistently on the AirConsole servers. Storage is per game. Total storage can not exceed 1 MB per game and uid. Storage is public, not secure and anyone can request and tamper with it. Do not store sensitive data.
Parameters:
Name Type Description
key String The key of the data entry.
value mixed The value of the data entry.
uid String The uid for which the data should be stored. For controllers, the default is the uid of this device. Screens must provide a valid uid.
Version:
  • 1.9.0 - uid is no longer optional for requests from the screen
Source: