SyncPolicy

data class SyncPolicy(val enabled: Boolean, val endpointPath: String = "events/batch", val batchSize: Int = 50, val requireUnmeteredNetwork: Boolean = false, val maxAttemptsPerEvent: Int = 12, val connectTimeoutSeconds: Long = 15, val readTimeoutSeconds: Long = 30, val writeTimeoutSeconds: Long = 30, val callTimeoutSeconds: Long = 60)

Network sync policy.

Default is disabled to avoid any silent off-device transfer. The host app must explicitly enable it.

Constructors

Link copied to clipboard
constructor(enabled: Boolean, endpointPath: String = "events/batch", batchSize: Int = 50, requireUnmeteredNetwork: Boolean = false, maxAttemptsPerEvent: Int = 12, connectTimeoutSeconds: Long = 15, readTimeoutSeconds: Long = 30, writeTimeoutSeconds: Long = 30, callTimeoutSeconds: Long = 60)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard

OkHttp end-to-end call timeout in seconds. Upper bound on a single batch send including retries and redirects; prevents a hung server from pinning a sync worker until Android kills it. Set to 0 to disable.

Link copied to clipboard

OkHttp connect timeout in seconds. Applied to the SDK-built HTTP client; ignored when the host supplies okHttpClientOverride to com.sarastarquant.kioskops.sdk.KioskOpsSdk.init.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Max attempts per event before we stop retrying automatically.

Link copied to clipboard

OkHttp read timeout in seconds. A slow server trickling bytes can stall a worker for a long time without callTimeoutSeconds; this caps inter-byte wait.

Link copied to clipboard

If true, periodic sync requires unmetered network (Wi-Fi). Useful for large payloads.

Link copied to clipboard

OkHttp write timeout in seconds.