CCPAStringBuilder
符合 IAB 1.0 最终文档的开源 CCPA String Builder:https://iabtechlab.com/wp-content/uploads/2019/11/U.S.-Privacy-String-v1.0-IAB-Tech-Lab.pdf
当前仅支持 Swift 语言(5.0)。
CCPAStringBuilder 包含 Source/CCPAStringBuilder.swift
类。使用示例
let privacyString = CCPAStringBuilder()
.set(explicitOptOut: true)
.set(optOutSale: true)
.set(limitedServiceProviderAgreement: true)
.build()
这种用法将产生 1YYY
和 us_privacy
字符串。每个参数可以设置为 true
或 false
,这将分别产生 Y
或 N
。未设置的参数将生成 -
字符。第一个字符始终是 1
,这是 IAB 版本规范。