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.
Methods
(static) getInstance(params) → {Firebase}
Returns a firebase instance, just as if you had called new Firebase()
By using syncInstance.parent() you can store cross-instance data like high scores. Likewise you can store persistent user data at syncInstance.parent().child([userId).
Parameters:
| Name | Type | Description | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object |
Properties
|
Example
var syncInstance = altspace.utilities.sync.getInstance({
// All sync instances with the same instance id will share
// properties.
instanceId: yourInstanceId,
// This helps to prevent collisions.
authorId: yourAuthorId
});