class DittoKit : Closeable
DittoKit
is the entry point for accessing Ditto-related functionality.
dependencies
- the dependencies required by the SDK to be initialised.
identity
- the identity to be used to represent the connected client.
dbConfig
- optional config that will be used to configure the internal database store.
DittoKit(dependencies: DittoKitDependencies, identity: DittoIdentity = DittoIdentity.Development(), dbConfig: DittoDBConfig = DittoDBConfig())
Creates a DittoKit instance. |
var activated: Boolean
flag indicating whether or not the SDK has been activated with an access license. |
|
var callback: DittoKitCallback?
an optional callback that will be called with lifecycle events relating to the SDK. |
|
val dependencies: DittoKitDependencies
the dependencies required by the SDK to be initialised. |
|
val sdkVersion: String
Returns a string identifying the version of the DittoKit SDK. |
|
val siteID: Long
the site ID component of the identity in use. |
|
val store: DittoStore
provides access to the SDK's store functionality. |
fun clearSiteID(): Unit
Clears the cached site ID, if one had been cached. |
|
fun close(): Unit
Closes the |
|
fun finalize(): Unit |
|
fun getTransportDiagnostics(): TransportDiagnostics
Request bulk status information about the transports. This is mostly intended for statistical or debugging purposes. |
|
fun observePeers(handler: (List<RemotePeer>) -> Unit): PeersObserver
Request information about Ditto peers in range of this device. |
|
fun refreshPermissions(): Unit
Provide a hint to DittoKit that app permissions may have changed. |
|
fun setAccessLicense(license: String): Unit
Activate a |
|
fun start(transports: Set<DittoTransports> = mutableSetOf(
DittoTransports.WiFi,
DittoTransports.Bluetooth
)): Unit
Start a set of transports being used by DittoKit to connect to other devices. This has no effect if a provided transport is already started. |
|
fun stop(): Unit
Stop all transports fun stop(transports: Set<DittoTransports>): Unit
Stop a set of transports from being used by DittoKit to connect to other devices. |
var deviceName: String
Configure a custom identifier for the current device. |
|
var logger: DittoLogger
The logger that will be used to log all Ditto-related logs. A default one is set that logs to logcat. |
|
var loggingEnabled: Boolean
Represents whether logging is enabled. |
|
var minimumLogLevel: LogLevel
The minimum log level at which logs will be logged, provided |