Last update : 04/08/2026
Release version : 5.2.0
- TCIAB Implementation Guide
- Introduction
- Setup
- JSON Configuration Files
- Filtering vendors
- Selecting buttons
- With the ServerSide
- Retaining consent
- Reacting to consent
- Generating publisher TC in consent string
- Loading a specific screen directly
- Troubleshooting
- Support and contacts
The TCIAB module adds IAB TCF v2 support to the Consent module. When TCIAB is linked alongside TCConsent, things that change:
-
The Privacy Center (
TCPrivacyCenterViewController) adds an IAB-compliant first layer on launch, before the category/vendor screen. -
The Privacy Center's category and vendor screens include IAB categories and vendors alongside any custom categories and vendors you have defined.
-
When consent is saved, TCF Consent String and other required value are also created and saved in-app.
Everything else — how consent is saved, forwarded to ServerSide, and accessed via callbacks — works identically to a non-IAB setup.
Note
This module only supports TCF v2. TCF v1 is not supported.
Add the TCIAB module alongside the TCConsent module. No additional initialisation code is required — once both modules are present, the Privacy Center automatically shows the IAB first layer on launch and generates the IAB consent string.
You will need several JSON configuration files. These are updated automatically by the library, but offline copies in your project prevent issues on poor or missing connections.
We support IAB 2.1. Add the following translation keys to your privacy.json to display the new information correctly:
"texts": {
"generic": {
"month": "months",
"day": "days",
"seconds": "seconds",
"hours": "hours"
},
"vendors": {
"deviceStorageTitle": "Storage Type:",
"deviceStorageCookieLifetime": "Cookie lifetime: ",
"deviceStorageOther": "Others",
"deviceStorageCookies": "Cookies"
}
}To upgrade to IAB 2.2, first upgrade TCConsent to version 5.4.1 or higher, then:
- Replace all offline in-app JSON files with IAB 2.2 compatible versions. This includes
vendor-list.jsonand anypurposes-xx.jsontranslation files. - Update your
privacy.json(both the offline copy and your CDN version) to be IAB 2.2 compatible. Review thevendorskey at the root to re-check your IAB vendor filter. - Ensure your
"popup" → "purposeTitle"value contains the{total_number}placeholder.
Add the following keys to your privacy.json:
"texts_xx": {
"generic": {
"illustationsButton": "illustrations:",
"dataCategoriesDef": "Data Categories:"
},
"vendors": {
"legIntClaimTitle": "Politique de legitimate"
},
"popup": {
"purposeTitle": "We and our {total_number} partners"
}
}This file contains all IAB-registered vendors, along with definitions (in English) for all purposes, special purposes, features, and special features.
Download an offline copy from https://vendorlist.consensu.org/v3/vendor-list.json and include it in your project under the same filename.
If your application supports multiple languages, you will need translation files for each language. These files are maintained by IAB.
Download translation files from https://register.consensu.org/translations/translationsEu under "List of translations for purpose descriptions TCF EU:", keeping the original filenames.
Call the following line right after initialising TCMobileConsent to set the language:
in swift:
TCMobileConsent.sharedInstance().setLanguage("fr")
// Use ISO 639-1 language codesin objective-c:
[[TCMobileConsent sharedInstance] setLanguage: @"fr"];
// Use ISO 639-1 language codesThis file declares the information used to record consent in our dashboards, as well as any texts in the interface that are not defined by IAB.
Warning
This file should be provided by your Commanders Act consultant.
If you are using multiple languages, you will find "texts" (the default) and one "texts_xx" block per additional language.
Note
This file is optional.
This file represents the restrictions your company (as publisher) applies to its partners. If you have one, include it alongside the other configuration files and call the following line right after initialising the Consent module:
in swift:
TCMobileConsent.sharedInstance().useCustomPublisherRestrictions()in objective-c:
[[TCMobileConsent sharedInstance] useCustomPublisherRestrictions];Warning
This should be decided by your project manager. The file should be created by your Commanders Act contact.
Note
This file is optional and only needed if you are using Google AC String.
Include this file alongside the other configuration files. Call the following line before initialising the Consent module:
in swift:
TCMobileConsent.sharedInstance().useAcString(true)in objective-c:
[[TCMobileConsent sharedInstance] useAcString: YES];If you are using AC String, also make sure your privacy.json contains a list of Google vendors. This file can only be provided by your consultant and will be updated automatically by the library.
By default, the full IAB vendor list is displayed. To show only the vendors your company uses, add a vendors field inside the "information" section of privacy.json:
"information": {
"vendors": "8,18,467,310"
}This filters the displayed vendors to those with the given IDs, and also filters the purposes and special features the user is asked to consent to.
Warning
This should be decided by your project manager and added to the JSON by your Commanders Act contact.
The IAB interface has two layers. The first layer is the initial popup screen. The second layer includes the purpose screen and the vendor screen.
Default buttons:
- First layer: Detail (opens the purpose screen), Accept All, Refuse All
- Second layer: Save (saves the current switch state), Accept All, Refuse All
IAB requires at least a Detail button on the first layer and a Save button on the second. Since September 2020, the CNIL requires that if you have an Accept All button, a Refuse All button with equal visual prominence must also be present.
To configure which buttons appear and in what order, add the following to your privacy.json:
"components": {
"firstLayerButton": ["Detail", "AcceptAll", "RefuseAll"],
"secondLayerButton": ["Save", "AcceptAll", "RefuseAll"]
}Remove entries you do not want. For example, to remove the Refuse All button, remove "RefuseAll" from the array.
In swift:
// Register callbacks first if needed.
TCMobileConsent.sharedInstance().registerCallback(self)
TCMobileConsent.sharedInstance().setSiteID(3311, andPrivacyID: 320)
// Set language if needed.
TCMobileConsent.sharedInstance().setLanguage("fr")In objective-c:
// Register callbacks first if needed.
[[TCMobileConsent sharedInstance] registerCallback: self];
[[TCMobileConsent sharedInstance] setSiteID: 3311 andPrivacyID: 320];
// Set language if needed.
[[TCMobileConsent sharedInstance] setLanguage: @"fr"];Using IAB with ServerSide requires no special handling. All saved IAB consent information is automatically forwarded in every ServerSide hit, so you can use any IAB purpose as a consent category and build rules around it in your container.
See the Consent module documentation.
See the Consent module documentation.
The publisher TC part of the consent string is not generated by default. To enable it, set the following boolean on TCMobilePrivacy:
TCMobilePrivacy.sharedInstance().generatePublisherTC = trueBy default, launching the Privacy Center with TCIAB shows the IAB first layer screen. If you have built your own first layer and want to open the Privacy Center directly to the second layer (purpose or vendor screen), bypassing the IAB first layer, use the following:
Purpose screen:
in swift:
let PCM = TCPrivacyCenterViewController()
PCM.startWithPurposeScreen()
self.navigationController?.pushViewController(PCM, animated: false)in objective-c:
TCPrivacyCenterViewController *PCM = [[TCPrivacyCenterViewController alloc] init];
[PCM startWithPurposeScreen];
[self.navigationController pushViewController: PCM animated: NO];Vendor screen:
in swift:
PCM.startWithVendorScreen()in objective-c:
[PCM startWithVendorScreen];Enable verbose logging before initialising the module:
in swift:
#if DEBUG
TCDebug.setLogLevel(.verbose)
#endifAfter the user saves consent in the Privacy Center, check the Xcode console for a log entry containing the generated IAB consent string. It will look something like:
[TCIAB] TC String generated: COwGmGhOwGmGh...
If this line does not appear:
- Confirm that
vendor-list.jsonandprivacy.jsonare present in your project bundle. - Confirm that both TCIAB and TCConsent are linked in your target.
- Confirm that you are using a TCConsent version that supports IAB 2.2 if you have upgraded your JSON files to 2.2.
Support support@commandersact.com
Commanders Act | 25 rue de Tolbiac, 75013 Paris - France
This documentation was generated on 04/08/2026 16:06:11
