File tree Expand file tree Collapse file tree 1 file changed +24
-1
lines changed
core/src/main/java/com/segment/analytics/kotlin/core Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,30 @@ data class System(
31
31
storage.read(Storage .Constants .Settings ) ? : " "
32
32
)
33
33
} catch (ignored: Exception ) {
34
- configuration.defaultSettings
34
+
35
+ // This could be an empty Settings...
36
+ if (configuration.defaultSettings.integrations.contains(" Segment.io" )) {
37
+ configuration.defaultSettings
38
+ } else {
39
+ Settings (
40
+ integrations = buildJsonObject {
41
+ put(
42
+ " Segment.io" ,
43
+ buildJsonObject {
44
+ put(
45
+ " apiKey" ,
46
+ configuration.writeKey
47
+ )
48
+ put(" apiHost" , Constants .DEFAULT_API_HOST )
49
+ })
50
+ },
51
+ plan = emptyJsonObject,
52
+ edgeFunction = emptyJsonObject,
53
+ middlewareSettings = emptyJsonObject
54
+ )
55
+ }
56
+
57
+
35
58
}
36
59
return System (
37
60
configuration = configuration,
You can’t perform that action at this time.
0 commit comments