Load notice by ID

By default, the Didomi SDK downloads the notice configuration from the Console by matching the package ID of the app with the IDs configured in the notice.

This works well for most use cases but does not allow granularly deciding what notice configuration should be loaded in an app. For instance, it does not allow loading different consent notices in different versions of a single app.

You can bypass app ID targeting and decide what consent notice to use in a given app by specifying the notice ID in the call to the initialize function:

Java
Kotlin
Swift
Objective-C
Java
Didomi.getInstance().initialize(
this,
"<Public API key>",
null,
null,
null,
false,
null,
"<Notice ID>"
);
Kotlin
Didomi.getInstance().initialize(
this,
"<Public API key>",
null,
null,
null,
false,
null,
"<Notice ID>"
)
Swift
Didomi.shared.initialize(apiKey: "<Public API Key>",
localConfigurationPath: nil,
remoteConfigurationURL: nil,
providerId: nil,
disableDidomiRemoteConfig: false,
languageCode: nil,
noticeId: "<Notice ID>)
Objective-C
Didomi *didomi = [Didomi shared];
[didomi initializeWithApiKey:@"<Public API Key>" localConfigurationPath:nil remoteConfigurationURL:nil providerId:nil disableDidomiRemoteConfig:NO languageCode:nil noticeId:@"<Notice ID>"];

Make sure to replace the following variables in the code above: