The Sync utility is currently based on Firebase. It provides a quick way to synchronize apps between users (even when they are running outside of AltspaceVR). During the SDK beta, please consider all data stored with the sync utility to be ephemeral (it may be cleared or clobbered at any time). You do not need a Firebase account to use the Sync utility.
Refer to the Firebase API documentation when working with the sync instance.
Classes
Methods
(static) connect(config) → {Promise}
Connect to a sync session to obtain Firebase references that can be used for syncronization of real-time and persistent state. Returns a promise that will fulfill with a Connection.
Note: Calling this method will cause a reload of the app, since it adds an 'altspace-sync-instance' query parameter to the app's url. Best practice is to establish a sync connection first, before you load any resources or render anything in your app. The promise returned by this method will be rejected the first time it is called, while the app reloads with the new sync instance id.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
config |
Object |
Properties
|