Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ internal class GetTCFDataMock {
),
tcString = "abc",
thirdPartyCount = 123,
featuresStandardText = "These means of processing can be used solely in pursuit of one or several purposes for which you are given a choice in this notice.",
)

val expected = mapOf(
Expand Down Expand Up @@ -213,6 +214,7 @@ internal class GetTCFDataMock {
),
"tcString" to "abc",
"thirdPartyCount" to 123,
"featuresStandardText" to "These means of processing can be used solely in pursuit of one or several purposes for which you are given a choice in this notice.",
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ internal fun TCFData.serialize(): WritableMap {
"stacks" to stacks.map { it.serialize() },
"vendors" to vendors.map { it.serialize() },
"tcString" to tcString,
"thirdPartyCount" to thirdPartyCount
"thirdPartyCount" to thirdPartyCount,
"featuresStandardText" to featuresStandardText
Comment thread
uc-brunosilva marked this conversation as resolved.
Resolved
).toWritableMap()
}

Expand Down
3 changes: 2 additions & 1 deletion ios/Extensions/TCFData+Dict.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ extension TCFData {
"stacks" : stacks.map { $0.toDictionary() },
"vendors" : vendors.map { $0.toDictionary() },
"tcString": tcString,
"thirdPartyCount": thirdPartyCount
"thirdPartyCount": thirdPartyCount,
"featuresStandardText": featuresStandardText as Any
Comment thread
uc-brunosilva marked this conversation as resolved.
Resolved
]
}
}
Expand Down
3 changes: 2 additions & 1 deletion sample/ios/sampleTests/Mock/TCFData+Mock.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ extension TCFData {
stacks: [.mock()],
vendors: [.mock()],
tcString: "abc",
thirdPartyCount: 123)
thirdPartyCount: 123,
featuresStandardText: "abc")
}
}

Expand Down
2 changes: 2 additions & 0 deletions sample/ios/sampleTests/RNUsercentricsModuleTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,7 @@ class RNUsercentricsModuleTests: XCTestCase {
let vendors = result["vendors"] as? [NSDictionary]
let tcString = result["tcString"] as? String
let thirdPartyCount = result["thirdPartyCount"] as? Int
let featuresStandardText = result["featuresStandardText"] as? String

XCTAssertNotNil(features)
XCTAssertNotNil(purposes)
Expand All @@ -462,6 +463,7 @@ class RNUsercentricsModuleTests: XCTestCase {
XCTAssertEqual(TCFVendor.mock().toDictionary(), vendors!.first)
XCTAssertEqual("abc", tcString)
XCTAssertEqual(123, thirdPartyCount)
XCTAssertEqual("abc", featuresStandardText)

} reject: { _, _, _ in
XCTFail("Should not go here")
Expand Down
3 changes: 2 additions & 1 deletion src/__tests__/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,8 @@ describe('Test Usercentrics Module', () => {
stacks: [],
vendors: [],
tcString: "ABCD1234",
thirdPartyCount: 13
thirdPartyCount: 13,
featuresStandardText: "These means of processing can be used solely in pursuit of one or several purposes for which you are given a choice in this notice."
}

RNUsercentricsModule.getTCFData.mockImplementationOnce(
Expand Down
7 changes: 6 additions & 1 deletion src/models/TCFData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ export class TCFData {
/// The total of vendors and services
thirdPartyCount: number

/// IAB-mandated standard text for the Features category (TCF 2.4), sourced from the GVL.
featuresStandardText?: string

Comment thread
uc-brunosilva marked this conversation as resolved.
Resolved
constructor(
features: TCFFeature[],
purposes: TCFPurpose[],
Expand All @@ -36,7 +39,8 @@ export class TCFData {
stacks: TCFStack[],
vendors: TCFVendor[],
tcString: String,
thirdPartyCount: number
thirdPartyCount: number,
Comment thread
uc-brunosilva marked this conversation as resolved.
Resolved
featuresStandardText?: string
) {
this.features = features
this.purposes = purposes
Expand All @@ -46,6 +50,7 @@ export class TCFData {
this.vendors = vendors
this.tcString = tcString
this.thirdPartyCount = thirdPartyCount
this.featuresStandardText = featuresStandardText
}
}

Expand Down
Loading