Overview
The State class can be used to store & fetch data in the user's phone
A State is a wrapper around the Persistence
module in Spark AR
States can hold any number, boolean, string, and/or Vector you want to store
Creating a State
To create a State, simply instance one, and provide a whitelisted Persistence module key
It's essential that the string provided corresponds to a whitelisted key. If it doesn't the State will throw an error
To whitelist a key, in Spark AR Studio, go to Project > Capabilities > + Persistence
and write the key in the text field, you can whitelist many keys by leaving a space in between keys. eg: key1 key2 keyN
Updating data
To update the data in a State, use the setValue method
Last updated