Step 3: Integration
How to use AppConsent
1. Get your AppKey
On AppConsent configuration interface https://app.appconsent.io, create your unified SDK source.

Then create your notice and retrieve your generated YOUR_APP_KEY

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, Custom ContentProvider, Splashscreen, or your "android.intent.category.LAUNCHER" activity.
Why timing your consent prompt matters
First impressions are critical. Users who encounter a consent dialog before experiencing any value from your app are significantly more likely to dismiss it — or abandon the app entirely.
By initializing the SDK early in the background while strategically delaying the CMP display, you ensure that when the consent prompt appears, users are already engaged. This small timing shift can have a measurable impact on positive consent rates, ad revenue, and long-term retention.
The goal is simple : make consent feel like a natural step in the experience, not a barrier to it.
Technical implementation
The SDK must be initialized as early as possible in your app's lifecycle. On startup, it bootstraps a WebView and initializes its JavaScript engine — a process that takes time. The earlier you trigger this, the sooner the SDK will be ready.
Initialization does not mean the SDK is immediately usable. You must wait for the onCmpReady callback before interacting with it. Only at that point can you safely call getInstance() and display the CMP.
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.
Best Practices
Waiting for the right moment to display the CMP is just as important as initializing the SDK early. Here are a few recommended triggers :
Before the first ad load — ensures consent is collected before any ad request is made, keeping you compliant by design.
After the onboarding flow — the user has already experienced value, making them more likely to engage positively with the consent prompt.
At a natural pause in the user journey — such as between two screens or after a key action, where an interruption feels least disruptive.
Avoid displaying the CMP on the very first screen of your app. Users who haven't yet experienced any value are significantly more likely to dismiss or ignore the prompt.
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.
Last updated