Third-party SDKs

The Didomi SDK shares the user consent status with vendors through the IAB GDPR Consent framework.

For vendors that support the framework (see the list here), the only thing you have to do is declare them in the list of vendors that your app uses (see the Getting Started section for more information on how to do that) and they will adapt their data processing to respect the user consent.

For other vendors, that do not implement the IAB specification, you will need to share the consent status with their SDK if they have an API to do so or prevent their SDK from loading until the user has given consent for the vendor and its purposes. This has to be done manually for every vendor.

Read on to see how to manage the different cases of non-IAB vendors.

Vendor with custom API

Some vendors will offer a custom (non-IAB) API to tell their SDK what the user consent status is. In that case, check the user consent status for the vendor and pass it to the SDK:

Java
Swift
Objective-C
public void loadVendor() {
Boolean consentStatusForVendor = Didomi.getInstance().getUserConsentStatusForVendorAndRequiredPurposes("vendor-id");
if (consentStatusForVendor == true) {
// We have consent for the vendor
// Initialize the vendor SDK and pass the positive consent status
} else {
// We do not have consent information yet
// Wait until we get the user information
Didomi.getInstance().addEventListener(new EventListener() {
@Override
public void consentChanged(ConsentChangedEvent event) {
loadVendor();
}
});
}
}
Didomi.getInstance().onReady(() -> {
loadVendor();
});
func loadVendor() {
let didomi = Didomi.shared
let consentStatus = didomi.getUserConsentStatusForVendorAndRequiredPurposes(vendorId: "vendor-id")
let didomiEventListener: EventListener
switch consentStatus {
case .enable:
// We have consent for the vendor
// Initialize the vendor SDK and pass the positive consent status
print("Enable")
case .disable:
// We do not have consent information yet
// Wait until we get the user information
didomiEventListener = EventListener()
didomiEventListener.onConsentChanged = { [unowned self] event in
self.loadVendor()
}
didomi.addEventListener(listener: didomiEventListener)
}
}
Didomi.shared.onReady {
loadVendor()
}
- (void)viewDidLoad {
[super viewDidLoad];
Didomi *didomi = [Didomi shared];
[didomi onReadyWithCallback:^{
[self loadVendor];
}];
}
- (void)loadVendor {
Didomi *didomi = [Didomi shared];
ConsentStatus consentStatusForVendor = [didomi getUserConsentStatusForVendorAndRequiredPurposesWithVendorId:@"vendor-id"];
DDMEventListener *didomiEventListener;
switch (consentStatusForVendor) {
case ConsentStatusEnable:
// We have consent for the vendor
// Initialize the vendor SDK and pass the positive consent status
break;
case ConsentStatusDisable:
// We do not have consent information yet
// Wait until we get the user information
didomiEventListener = [[DDMEventListener alloc] init];
[didomiEventListener setOnConsentChanged:^(enum DDMEventType event) {
[self loadVendor];
}];
[didomi addEventListenerWithListener:didomiEventListener];
break;
}
}

Vendor without a custom API

For vendors that do not offer a custom API to share the user consent status, your only option is to not load their SDK until the user has given consent. Use the following snippet of code to get started:

Java
Swift
Objective-C
public void loadVendor() {
Boolean consentStatusForVendor = Didomi.getInstance().getUserConsentStatusForVendorAndRequiredPurposes("vendor-id");
if (consentStatusForVendor == true) {
// We have consent for the vendor
// Initialize the vendor SDK
} else {
// We do not have consent information yet
// Wait until we get the user information
Didomi.getInstance().addEventListener(new EventListener() {
@Override
public void consentChanged(ConsentChangedEvent event) {
loadVendor();
}
});
}
}
Didomi.getInstance().onReady(() -> {
loadVendor();
});
func loadVendor() {
let didomi = Didomi.shared
let consentStatus = didomi.getUserConsentStatusForVendorAndRequiredPurposes(vendorId: "vendor-id")
let didomiEventListener: EventListener
switch consentStatus {
case .enable:
// We have consent for the vendor
// Initialize the vendor SDK
print("Enable")
case .disable:
// We do not have consent information yet
// Wait until we get the user information
didomiEventListener = EventListener()
didomiEventListener.onConsentChanged = { [unowned self] event in
self.loadVendor()
}
didomi.addEventListener(listener: didomiEventListener)
}
}
Didomi.shared.onReady {
loadVendor()
}
- (void)viewDidLoad {
[super viewDidLoad];
Didomi *didomi = [Didomi shared];
[didomi onReadyWithCallback:^{
[self loadVendor];
}];
}
- (void)loadVendor {
Didomi *didomi = [Didomi shared];
ConsentStatus consentStatusForVendor = [didomi getUserConsentStatusForVendorAndRequiredPurposesWithVendorId:@"vendor-id"];
DDMEventListener *didomiEventListener;
switch (consentStatusForVendor) {
case ConsentStatusEnable:
// We have consent for the vendor
// Initialize the vendor SDK
break;
case ConsentStatusDisable:
// We do not have consent information yet
// Wait until we get the user information
didomiEventListener = [[DDMEventListener alloc] init];
[didomiEventListener setOnConsentChanged:^(enum DDMEventType event) {
[self loadVendor];
}];
[didomi addEventListenerWithListener:didomiEventListener];
break;
}
}