To integrate the Android SDK into your app, follow the steps outlined below.
1
Add the TrustArc Maven repository to either your project's
build.gradlerepositories
section or
settings.gradledependencyResolutionManagement
section, depending on which file your project uses for
dependency management.
Note: The GitHub access token required for authentication will be provided by your representative from the TrustArc support team at support@trustarc.com. Make sure to keep this token secured and do not expose it in version control.
repositories {
google()
mavenCentral()
maven {
name = "TrustArcMobileConsent"
url = uri("https://maven.pkg.github.com/trustarc/trustarc-mobile-consent")
credentials {
username = "trustarc"
password = "<Paste Your Token Here>"
}
}
}
2
Add the SDK dependency to your app module's
build.gradle:
dependencies {
// You can use "+" to always use the latest release
implementation("com.trustarc:trustarc-consent-sdk:2025.04.2")
// Required dependencies
implementation("androidx.core:core-ktx:1.9.0")
implementation("androidx.appcompat:appcompat:1.6.1")
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
implementation("androidx.webkit:webkit:1.4.0")
implementation("androidx.lifecycle:lifecycle-extensions:2.2.0")
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2")
implementation("androidx.activity:activity:1.8.0")
implementation("com.google.android.material:material:1.9.0")
implementation("com.squareup.retrofit2:retrofit:2.9.0")
implementation("com.squareup.retrofit2:converter-gson:2.9.0")
}
3
In your Activity, use the SDK as follows:
// Set up TrustArc SDK
trustArcSDK = TrustArc(
context = applicationContext,
sdkMode = SdkMode.Standard
)
// Begin domain configuration retrieval
// Note: consent modal will automatically appear in "expressed" mode
trustArcSDK.start(
domainName = "mac_trustarc.com"
// optionally: country = "us", language = "en"
)
TrustArc · Mobile App Consent — Android SDK: Getting Started · www.trustarc.com