Data must be saved through the GMI. This ensures all data access complies with BBC data policies.
gmi.setGameData(key, value);
Stores a JSON key-value pair that can then be retrieved with getAllSettings()
.
gmi.getAllSettings();
Returns a JSON object with global settings and specific game data.
Specific game data is stored under gameData
:
gmi.getAllSettings().gameData;
This object will contain all of the properties set by this game using setGameData
.
Global settings can be accessed like so:
gmi.getAllSettings().audio;
gmi.getAllSettings().motion;
gmi.getAllSettings().subtitles;