Didomi.frameworkfile into the
Copy items if neededbox is checked and click on
Always Embed Swift Standard Librariesflag is set to
YESas shown in the image below:
AppDelegate, make sure to import the
Didomimodule, then call the
initializemethod and pass your API key:
Didomiobject until it is actually ready to handle your requests. Use the
onReadyclosure in Swift or the
onReadyWithCallbackmethod in Objective-C to register a listener for the ready event.
UIViewController. Make sure to import the
Didomimodule and call the
setupUImethod in Swift,
setupUIWithContainerControllerin Objective-C, of the SDK in the
viewDidLoadmethod of your main
setupUIfunction is called on every activity that the user can launch the app on. This will ensure that consent is always collected as needed and there is no path where the user can launch the app without consent being collected. If
setupUIis missing at some entry points, you will see lower consent rates as users will be using the app without giving consent.
falsewhen calling the initialize method as shown below.
didomi_config.jsonfile that must be placed somewhere under your project folder (see the image below for reference). Create a file with the following content to get started:
initializecall to set the
didomi_config.jsonconfiguration file from. That allows you to update the SDK configuration without having to re-publish you mobile application.
didomi_config.json(provided in the app bundle) as a fallback.
app.vendors.iab.requireUpdatedGVLflat set to false in the CUSTOM JSON section when editing your notice on the Console app (or in your local
didomi_config.jsonfile if that's the case).
app.vendors.iab.updateGVLTimeoutproperty (in seconds).
UIViewController. We need this to make sure we call the
setupUImethod when the
viewDidlLoadmethod is called.
UIViewControllerRepresentableprotocol as shown below:
UIApplicationDelegatefunctionality. Since we want to initialize the Didomi SDK as early as possible we recommend creating a class that implements the
UIApplicationDelegateprotocol. Inside the
applicationDidFinishLaunchingWithOptionsmethod, call the Didomi
Appprotocol. Use the
UIApplicationDelegateAdaptorproperty wrapper to connect this new struct with the
AppDelegateclass. Make sure this new struct uses the
mainannotation. Now you are ready to use the new
DidomiWrapperstruct that you created in the previous steps.