Step 3: Integration
How to use AppConsent
1. Get your AppKey
The first step is to create your source / notice and retrieve your generated YOUR_APP_KEY from AppConsent : https://app.appconsent.io

2. Initialize AppConsent & use it
The second step is to initialize the SDK and wait for it to be started before using it.
TIP
We recommend you do this in the application class, splashscreen, or your "android.intent.category.LAUNCHER" activity.
The idea is to be able to display the CMP as soon as possible, so that you can load your advertising supplier.
INFO
Even if your ad provider registers with the user consent update events and this is transparent to you, some providers may not work correctly with this solution. For this reason, we recommend that you initialize your provider's SDK only when consent has been given, to ensure that your ads are in accordance with user consent. Think to update it each time the user updates his consent too, thank to callbacks
INFO
In the example below, the code focuses on using the SDK exclusively. The potential imports and visual elements in these examples are therefore not present, as they are strongly linked to the Android structure and project, which are independent of the SDK.
Kotlin
Java
INFO
In the example below, the code focuses on using the SDK exclusively. The potential imports and visual elements in these examples are therefore not present, as they are strongly linked to the Android structure and project, which are independent of the SDK.
Kotlin
Java
3. Suggest CMP to your users
It is also advisable to provide your users with an entry allowing them to view and modify their consent, such as a configuration screen.
INFO
In the example below, the code focuses on using the SDK exclusively. The potential imports and visual elements in these examples are therefore not present, as they are strongly linked to the Android structure and project, which are independent of the SDK.
Kotlin
Java
INFO
In the example below, the code focuses on using the SDK exclusively. The potential imports and visual elements in these examples are therefore not present, as they are strongly linked to the Android structure and project, which are independent of the SDK.
Kotlin
Java
NOTE
Would you like a more complete example? We suggest you read the Go further page and take a look at the technical documentation.
Last updated