Setup
Add the SDK to your project
SDK is available from pub.dev: https://pub.dev/packages/didomi_sdk/install
Add the Didomi SDK dependency:
This will add a line like this to your package's pubspec.yaml (and run an implicit dart pub get
):
Afterwards, to update the dependency to the latest version, you can use the command
On Android, the error Module was compiled with an incompatible version of Kotlin.
may occur. Make sure ext.kotlinVersion
is set to 1.5.31
in android/build.gradle
.
Then you can import project from your dart code:
Initialize the SDK
Once our SDK has been added to your project, you need to initialize it. The initialization process will prepare the SDK for interactions with the user and your application. It is important to launch the SDK initialization as soon as possible.
In your code, call the initialize
method and pass your API key: