From 3000e0651a84932a0b12f92f020a54411fbd4657 Mon Sep 17 00:00:00 2001 From: lamrowena <108421200+lamrowena@users.noreply.github.com> Date: Wed, 3 Jan 2024 14:46:52 -0500 Subject: [PATCH] CTV Support --- .DS_Store | Bin 0 -> 6148 bytes TCFv2/IAB Tech Lab - CMP API v2.md | 90 +++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..054fff49623a5d54944b14bb9e196095016f94db GIT binary patch literal 6148 zcmeH~J#GR)427Qwk&tL8Q%;iuBqtd0lM93cAV8@iQ6Q-2=sbJeut|+p=vnf-v1hzL zU$L_WV9U$#16Tl<(OvQG!@!L3E4EnS3s-#p9M6aS>GbPqOmeRWbYA0rJ(ndSAOa#F z0wN#+BO(xoIM4t2h@MH0A_5{X4g&stD0J7F+PcQ4gG00c)G53}{wEG>Cu*3<$jRc;V;&hW=mw zKPXWs0wVBa1Z=wgUN8AldA9y}J+?pZ#&!;OKLHHApplication Preferences (Registry) + +Application Preferences, also referred to as a Registry in certain CTV environments, shall be used in a Native CTV Application environment under the condition that the TC data and TC String fit within the device constraints. Private Storage is to be used if the TC data and TC String do not fit within the device constraints + +Private Storage + +Private Storage shall be used under the condition that the CTV environment does not offer a Web Runtime that supports the Web Storage (Second Edition) specification, data does not persist beyond the lifecycle of the Application, or offer an Application Preferences (Registry) interface. The TC data and TC String are to be saved in a standardized and private storage space. Files are to follow the same naming convention as the key names detailed in the [TCF EU Section spec](https://github.com/InteractiveAdvertisingBureau/Global-Privacy-Platform/blob/main/Sections/EEA/GPPExtension%3A%20IAB%20Europe%20TCF.md#key-names) and the key names outlined for in-app usage [above](#what-is-the-cmp-in-app-internal-structure-for-the-defined-api) with the contents being the value of the corresponding key. +Note: CTV Applications require proper permission scopes to be configured to read and write to the virtual Application file system. + +#### CTV Examples + +**Android TV** +```java +// Option 1 +public void setTCString(String tcString) { + SharedPreferences.Editor editor = sharedPrefs.edit(); + // TCF spec + editor.putString("IABTCF_TCString", tcString); + // GPP spec + editor.putString("IABGPP_2_TCString", tcString); + editor.commit(); +} + +// Option 2 +public void setTCString(String tcString) { + SharedPreferences.Editor editor = sharedPrefs.edit(); + editor.putString("IABTCF_TCString", tcString); + editor.commit(); +} +public void setTCStringForGpp(String tcString) { + SharedPreferences.Editor editor = sharedPrefs.edit(); + editor.putString("IABGPP_2_TCString", tcString); + editor.commit(); +} +`````` + +**Apple TV** +```java +// Option 1 +- (void)setTcString:(NSString *)tcString { + NSUserDefaults *userDefaults = NSUserDefaults.standardUserDefaults; + // TCF spec + [userDefaults setObject:tcString forKey:@"IABTCF_TCString"]; + // GPP spec + [userDefaults setObject:tcString forKey:@"IABGPP_2_TCString"]; +} + +// Option 2 +- (void)setTcString:(NSString *)tcString[INSERT] { + NSUserDefaults *userDefaults = NSUserDefaults.standardUserDefaults; + [userDefaults setObject:tcString forKey:@"IABTCF_TCString"]; +} +- (void)setTcStringForGpp:(NSString *)tcString[INSERT] { + NSUserDefaults *userDefaults = NSUserDefaults.standardUserDefaults; + [userDefaults setObject:tcString forKey:@"IABGPP_2_TCString"]; +`````` + +**Roku [Reference](https://developer.roku.com/docs/references/brightscript/components/roregistrysection.md)** +```java +Function SetTcfData(tcString As String) As Void + sec = CreateObject("roRegistrySection", "TCF") + sec.Write("IABTCF_TCString", tcString) + sec.Flush() +End Function + +Function SetGppData(tcString As String) As Void + sec = CreateObject("roRegistrySection", "GPP") + sec.Write("IABGPP_2_TCString", tcString) + sec.Flush() +End Function +`````` ______