Skip to content

Commit ad7f4ca

Browse files
author
Vailence
committed
MOBILE-160: minor cleanups around operationsDomain
- Configuration dartdoc: use Dart `null`/empty wording, remove the native-config reference that leaks SDK-internal behavior. - MindboxAndroidPlugin: rename local to operationsDomainArg and apply the builder method outside the chain to avoid name collision with the builder method. - example: drop the placeholder commented-out arg from the sample app.
1 parent 0598966 commit ad7f4ca

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

mindbox_android/android/src/main/kotlin/cloud/mindbox/mindbox_android/MindboxAndroidPlugin.kt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,16 @@ class MindboxAndroidPlugin : FlutterPlugin, MethodCallHandler, ActivityAware, Ne
7272
val previousInstallId: String = args["previousInstallationId"] as String
7373
val subscribeIfCreated: Boolean = args["subscribeCustomerIfCreated"] as Boolean
7474
val shouldCreateCustomer: Boolean = args["shouldCreateCustomer"] as Boolean
75-
val operationsDomain: String = args["operationsDomain"] as? String ?: ""
76-
val config = MindboxConfiguration.Builder(context.applicationContext, domain, endpointId)
75+
val operationsDomainArg: String = args["operationsDomain"] as? String ?: ""
76+
val builder = MindboxConfiguration.Builder(context.applicationContext, domain, endpointId)
7777
.setPreviousDeviceUuid(previousDeviceUuid)
7878
.setPreviousInstallationId(previousInstallId)
7979
.subscribeCustomerIfCreated(subscribeIfCreated)
8080
.shouldCreateCustomer(shouldCreateCustomer)
81-
.apply { if (operationsDomain.isNotEmpty()) operationsDomain(operationsDomain) }
82-
.build()
81+
if (operationsDomainArg.isNotEmpty()) {
82+
builder.operationsDomain(operationsDomainArg)
83+
}
84+
val config = builder.build()
8385
Mindbox.init(activity = context, config, listOf())
8486
result.success("initialized")
8587
} else {

mindbox_platform_interface/lib/src/types/configuration.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ class Configuration {
1515
/// Used for generating baseurl for REST.
1616
final String domain;
1717

18-
/// Optional host for sending operations. Overridden by
19-
/// the value from the mobile JSON config when present. Default `nil` (use `domain`).
18+
/// Optional separate host for sending operations. When empty, [domain]
19+
/// is used. Default is an empty string.
2020
final String operationsDomain;
2121

2222
/// Used for app identification on iOS.

0 commit comments

Comments
 (0)