Skip to content

Commit

Permalink
default constructor support for ios
Browse files Browse the repository at this point in the history
  • Loading branch information
Shahroz16 committed Nov 14, 2022
1 parent 025c170 commit 887d08e
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, ModuleConfig> = mutableMapOf(),
) {

internal val moduleConfig: MutableMap<String, ModuleConfig> = 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.
*/
Expand Down

0 comments on commit 887d08e

Please sign in to comment.