diff --git a/shared/src/commonMain/kotlin/io/customer/shared/di/KMMComponent.kt b/shared/src/commonMain/kotlin/io/customer/shared/di/KMMComponent.kt index e9ee0ac..d1620f2 100644 --- a/shared/src/commonMain/kotlin/io/customer/shared/di/KMMComponent.kt +++ b/shared/src/commonMain/kotlin/io/customer/shared/di/KMMComponent.kt @@ -41,6 +41,14 @@ class KMMComponent( staticComponent = staticComponent, platform = platform, ) + + constructor(platform: Platform, sdkConfig: CustomerIOConfig, sdkCallback: SDKCallback) : this( + staticComponent = KMMStaticComponent(), + platform = platform, + sdkConfig = sdkConfig, + sdkCallback = sdkCallback, + ) + val backgroundQueue: BackgroundQueue get() = getSingletonInstance { BackgroundQueueImpl( diff --git a/shared/src/commonMain/kotlin/io/customer/shared/sdk/config/CustomerIOConfig.kt b/shared/src/commonMain/kotlin/io/customer/shared/sdk/config/CustomerIOConfig.kt index ef42516..d0dd444 100644 --- a/shared/src/commonMain/kotlin/io/customer/shared/sdk/config/CustomerIOConfig.kt +++ b/shared/src/commonMain/kotlin/io/customer/shared/sdk/config/CustomerIOConfig.kt @@ -13,13 +13,37 @@ import io.customer.shared.util.LogLevel * @property moduleConfig map to hold module configurations, having a map it makes it easier to * attach them later. */ -data class CustomerIOConfig( +data class CustomerIOConfig constructor( val logLevel: LogLevel = DefaultValue.LOG_LEVEL, val workspace: Workspace, val network: NetworkConfig = NetworkConfig.default(), val backgroundQueue: BackgroundQueueConfig = BackgroundQueueConfig.default(), - internal val moduleConfig: MutableMap = mutableMapOf(), ) { + + internal val moduleConfig: MutableMap = mutableMapOf() + + constructor(workspace: Workspace) : this( + logLevel = DefaultValue.LOG_LEVEL, + workspace = workspace, + ) + + constructor(workspace: Workspace, backgroundQueue: BackgroundQueueConfig) : this( + logLevel = DefaultValue.LOG_LEVEL, + workspace = workspace, + backgroundQueue = backgroundQueue, + ) + + constructor( + workspace: Workspace, + backgroundQueue: BackgroundQueueConfig, + network: NetworkConfig, + ) : this( + logLevel = DefaultValue.LOG_LEVEL, + workspace = workspace, + backgroundQueue = backgroundQueue, + network = network, + ) + /** * Constant class to hold default values. */