Skip to content

//sorisdk/com.iplateia.sorisdk/SORIConfig

SORIConfig

data class SORIConfig(val enableDelayedSending: Boolean = true, val maxPendingTimeMillis: Long = 10 * 60 * 1000L, val autoRetryOnNetworkRecovery: Boolean = true)

Configuration class for SORI SDK network handling and offline support behavior.

This configuration allows you to customize how the SDK handles network failures and manages offline scenarios. You can control whether failed requests are queued, how long they're retained, and whether they're automatically retried.

Configuration Options

The SDK provides three main configuration parameters:

  • enableDelayedSending: Controls whether to queue failed requests
  • maxPendingTimeMillis: Sets the maximum age for queued requests
  • autoRetryOnNetworkRecovery: Controls automatic retry behavior

Behavior Summary

Network StatusenableDelayedSendingBehavior
Availabletrue or falseRequest sent immediately
UnavailabletrueRequest queued for later delivery
UnavailablefalseRequest discarded

Usage Example

kotlin
val config = SORIConfig(
    enableDelayedSending = true,
    maxPendingTimeMillis = 600000L, // 10 minutes
    autoRetryOnNetworkRecovery = true
)

val recognizer = SORIAudioRecognizer(apiKey, secretKey)
recognizer.setConfig(config)

Since

1.0.0

See also

PendingRequestManager
NetworkUtils

Constructors

SORIConfig[androidJvm]
constructor(enableDelayedSending: Boolean = true, maxPendingTimeMillis: Long = 10 * 60 * 1000L, autoRetryOnNetworkRecovery: Boolean = true)
Creates a new SORIConfig with the specified settings

Types

NameSummary
Companion[androidJvm]
object Companion

Properties

NameSummary
autoRetryOnNetworkRecovery[androidJvm]
val autoRetryOnNetworkRecovery: Boolean = true
Controls whether queued requests are automatically processed when network connectivity is restored.
enableDelayedSending[androidJvm]
val enableDelayedSending: Boolean = true
Controls whether failed requests due to network unavailability are queued for later delivery.
maxPendingTimeMillis[androidJvm]
val maxPendingTimeMillis: Long
Maximum time in milliseconds to keep pending requests in the queue.