diff --git a/android/src/androidTest/java/com/usercentrics/reactnative/mock/GetTCFDataMock.kt b/android/src/androidTest/java/com/usercentrics/reactnative/mock/GetTCFDataMock.kt index 3695e27..437f58c 100644 --- a/android/src/androidTest/java/com/usercentrics/reactnative/mock/GetTCFDataMock.kt +++ b/android/src/androidTest/java/com/usercentrics/reactnative/mock/GetTCFDataMock.kt @@ -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( @@ -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.", ) } } diff --git a/android/src/main/java/com/usercentrics/reactnative/extensions/TCFDataExtensions.kt b/android/src/main/java/com/usercentrics/reactnative/extensions/TCFDataExtensions.kt index 05e6e7b..5bdcdef 100644 --- a/android/src/main/java/com/usercentrics/reactnative/extensions/TCFDataExtensions.kt +++ b/android/src/main/java/com/usercentrics/reactnative/extensions/TCFDataExtensions.kt @@ -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 ).toWritableMap() } diff --git a/ios/Extensions/TCFData+Dict.swift b/ios/Extensions/TCFData+Dict.swift index 9a03607..fd964cc 100644 --- a/ios/Extensions/TCFData+Dict.swift +++ b/ios/Extensions/TCFData+Dict.swift @@ -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 ] } } diff --git a/sample/ios/sampleTests/Mock/TCFData+Mock.swift b/sample/ios/sampleTests/Mock/TCFData+Mock.swift index d902b02..044a496 100644 --- a/sample/ios/sampleTests/Mock/TCFData+Mock.swift +++ b/sample/ios/sampleTests/Mock/TCFData+Mock.swift @@ -10,7 +10,8 @@ extension TCFData { stacks: [.mock()], vendors: [.mock()], tcString: "abc", - thirdPartyCount: 123) + thirdPartyCount: 123, + featuresStandardText: "abc") } } diff --git a/sample/ios/sampleTests/RNUsercentricsModuleTests.swift b/sample/ios/sampleTests/RNUsercentricsModuleTests.swift index 62756f6..687178e 100644 --- a/sample/ios/sampleTests/RNUsercentricsModuleTests.swift +++ b/sample/ios/sampleTests/RNUsercentricsModuleTests.swift @@ -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) @@ -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") diff --git a/src/__tests__/index.test.ts b/src/__tests__/index.test.ts index 34076f5..be46961 100644 --- a/src/__tests__/index.test.ts +++ b/src/__tests__/index.test.ts @@ -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( diff --git a/src/models/TCFData.tsx b/src/models/TCFData.tsx index 83bc73e..4440e10 100644 --- a/src/models/TCFData.tsx +++ b/src/models/TCFData.tsx @@ -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 + constructor( features: TCFFeature[], purposes: TCFPurpose[], @@ -36,7 +39,8 @@ export class TCFData { stacks: TCFStack[], vendors: TCFVendor[], tcString: String, - thirdPartyCount: number + thirdPartyCount: number, + featuresStandardText?: string ) { this.features = features this.purposes = purposes @@ -46,6 +50,7 @@ export class TCFData { this.vendors = vendors this.tcString = tcString this.thirdPartyCount = thirdPartyCount + this.featuresStandardText = featuresStandardText } }