Ditto

class Ditto @JvmOverloads() constructor(dependencies: DittoDependencies, identity: DittoIdentity)

Ditto is the entry point for accessing Ditto-related functionality.

Parameters

dependencies

the dependencies required by the SDK to be initialised.

identity

the identity to be used to represent the connected client.

Constructors

Ditto
Link copied to clipboard
fun Ditto(dependencies: DittoDependencies, identity: DittoIdentity = DittoIdentity.Development(dependencies))
Creates a Ditto instance.

Types

Companion
Link copied to clipboard
object Companion

Functions

getStore
Link copied to clipboard
fun getStore(): DittoStore
Provides access to the SDK's store functionality.
getTransportDiagnostics
Link copied to clipboard
fun getTransportDiagnostics(): DittoTransportDiagnostics
Request bulk status information about the transports.
observePeers
Link copied to clipboard
fun observePeers(handler: (List<DittoRemotePeer>) -> Unit): DittoPeersObserver
Request information about Ditto peers in range of this device.
fun observePeers(callback: DittoPeersObserverCallback): DittoPeersObserver
Request information about Ditto peers in range of this device.
refreshPermissions
Link copied to clipboard
fun refreshPermissions()
Provide a hint to Ditto that app permissions may have changed.
runGarbageCollection
Link copied to clipboard
fun runGarbageCollection()
Removes all sync metadata for any remote peers which aren't currently connected.
setAccessLicense
Link copied to clipboard
fun setAccessLicense(licenseToken: String)
Activate a Ditto instance by setting a license token.
setLicenseToken
Link copied to clipboard
fun setLicenseToken(licenseToken: String)
Activate a Ditto instance by setting a license token.
setTransportConfig
Link copied to clipboard
fun setTransportConfig(config: DittoTransportConfig)
Assign a new transports configuration.
startSync
Link copied to clipboard
fun startSync()
Starts the network transports.
stopSync
Link copied to clipboard
fun stopSync()
Stops all network transports.
tryStartSync
Link copied to clipboard
fun tryStartSync()
Starts the network transports.

Properties

activated
Link copied to clipboard
var activated: Boolean = false
flag indicating whether or not the SDK has been activated with a valid license token.
auth
Link copied to clipboard
var auth: DittoAuthenticator
provides access to authentication methods for logging on to Ditto Cloud.
callback
Link copied to clipboard
var callback: DittoCallback? = null
an optional callback that will be called with lifecycle events relating to the SDK.
sdkVersion
Link copied to clipboard
val sdkVersion: String
Returns a string identifying the version of the Ditto SDK.
siteID
Link copied to clipboard
val siteID: BigInteger
the site ID component of the identity in use.
store
Link copied to clipboard
val store: DittoStore
Provides access to the SDK's store functionality.