Skip to content

Commit 6563d95

Browse files
committed
Use server-computed unmapped destinations.
1 parent af9346f commit 6563d95

File tree

6 files changed

+12
-3
lines changed

6 files changed

+12
-3
lines changed

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ let package = Package(
88
platforms: [
99
.macOS("10.15"),
1010
.iOS("13.0"),
11-
.tvOS("11.0"),
11+
.tvOS("11.0")
1212
],
1313
products: [
1414
// Products define the executables and libraries a package produces, and make them visible to other packages.

Sources/SegmentConsent-Tests/Resources/DestinationsMultipleCategories.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
"legacyVideoPluginsEnabled": false,
6565
"remotePlugins": [],
6666
"consentSettings": {
67+
"hasUnmappedDestinations": false,
6768
"allCategories": [
6869
"C0001",
6970
"C0002",

Sources/SegmentConsent-Tests/Resources/NoUnmappedDestinations.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@
9393
"legacyVideoPluginsEnabled": false,
9494
"remotePlugins": [],
9595
"consentSettings": {
96+
"hasUnmappedDestinations": false,
9697
"allCategories": [
9798
"C0001",
9899
"C0002",

Sources/SegmentConsent-Tests/Resources/UnmappedDestinations.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@
8989
"legacyVideoPluginsEnabled": false,
9090
"remotePlugins": [],
9191
"consentSettings": {
92+
"hasUnmappedDestinations": false,
9293
"allCategories": [
9394
"C0001",
9495
"C0002",

Sources/SegmentConsent-Tests/UnmappedDestinationsTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ final class UnmappedDestinationsTests: XCTestCase {
7373

7474
RunLoop.main.run(until: Date.distantPast)
7575

76-
XCTAssertTrue(segmentOutput.lastEvent != nil)
76+
XCTAssertTrue(segmentOutput.lastEvent == nil)
7777
XCTAssertTrue(output1.lastEvent == nil)
7878
XCTAssertTrue(output2.lastEvent == nil)
7979
XCTAssertTrue(output3.lastEvent == nil)

Sources/SegmentConsent/Manager.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ extension ConsentManager {
128128
return newEvent
129129
}
130130

131-
internal func hasUnmappedDestinations(_ settings: Settings) -> Bool {
131+
/*internal func hasUnmappedDestinations(_ settings: Settings) -> Bool {
132132
var result = false
133133
if let integrations = settings.integrations?.dictionaryValue {
134134
result = !integrations.allSatisfy { (key: String, value: Any) in
@@ -144,6 +144,12 @@ extension ConsentManager {
144144
}
145145
}
146146
return result
147+
}*/
148+
internal func hasUnmappedDestinations(_ settings: Settings) -> Bool {
149+
if let hasUnmapped = settings.consentSettings?["hasUnmappedDestinations"]?.boolValue {
150+
return hasUnmapped
151+
}
152+
return true
147153
}
148154

149155
internal func enabledAtSegment(_ settings: Settings) -> Bool {

0 commit comments

Comments
 (0)