NexaGuard
    NexaGuard
    • NexaGuard Onboarding
    • iOS Setup
    • Android Setup
    • Web Setup
    • Webflow and Wix
    • WordPress Integration
    • Drupal Integration
    • Shopify Integration
    • LICENSE

    Android Setup

    NexaGuard CMP SDK – Android Setup

    Artifactimplementation("com.nexaguard:nxg-sdk:1.+")
    MinimumAPI 24 · Kotlin 1.9 · AGP 8
    Footprint≈ 200 kB AAR

    1 Add Maven Central

    settings.gradle (top‑level):

    pluginManagement {
      repositories {
        gradlePluginPortal()
        google()
        mavenCentral()
      }
    }
    

    2 Add the dependency

    app/build.gradle.kts:

    dependencies {
        implementation("com.nexaguard:nxg-sdk:1.+")   // always latest 1.x
    }
    

    Snapshot builds? Use 1.0.2-SNAPSHOT plus
    maven { url = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/") }.


    3 Initialise & show the banner

    Jetpack Compose

    @Composable
    fun MainScreen() {
        val ctx = LocalContext.current
    
        LaunchedEffect(Unit) {
            NexaGuardCMP.initialize(ctx, "YOUR_SETTINGS_ID")
        }
    
        Button(onClick = { NexaGuardCMP.showBanner(ctx, force = true) }) {
            Text("Show CMP")
        }
    }
    

    Classic View‑based (Activity)

    class MainActivity : AppCompatActivity() {
    
        override fun onCreate(savedInstanceState: Bundle?) {
            super.onCreate(savedInstanceState)
    
            // 1. initialise once
            NexaGuardCMP.initialize(this, "YOUR_SETTINGS_ID")
    
            // 2. UI that can re‑open the banner
            Button(this).apply {
                text = "Review Consent"
                setOnClickListener { NexaGuardCMP.forceShowBanner(this@MainActivity) }
            }.also { setContentView(it) }
        }
    }
    

    4 Public API surface

    CallPurpose
    initialize(context, settingsId)Loads branding & GVL; persists consent locally.
    showBanner(context, force = false)Shows banner (use force = true to reopen).
    acceptAllSelections() / rejectAllSelections()Quick buttons inside second layer.
    applyCustomSelections(purposes, vendors)Persist custom matrix from your own UI.

    5 Consent Mode: Basic vs. Advanced

    NexaGuard CMP fully supports Google Consent Mode.

    What are the options?

    • Basic configuration

      • Google tags are blocked until the user provides consent.
      • No analytics, ads, or personalization tags will fire before the user’s decision.
      • This approach is privacy-focused and is often recommended for jurisdictions with strict consent requirements.
    • Advanced configuration

      • Google tags fire immediately on page load, even before the user provides consent.
      • Tags collect only limited, anonymized (cookieless) signals until the user makes a choice.
      • Once a consent decision is made, tag behavior updates automatically.

    Note: Consent Mode is a technical solution for tag management and measurement.
    It does not by itself ensure legal compliance (such as with GDPR).
    For more details and implementation options, see:
    Consent Mode – Basic
    Consent Mode – Advanced

    How to select your configuration

    • By default, NexaGuard CMP uses the “Basic” (blocking) mode.
    • To switch to Advanced mode (allow tags before consent), update your configuration [via dashboard setting, script parameter, or by contacting support].
    • You can also customize consent mode behavior per region in your NexaGuard dashboard (feature coming soon).

    Full docs ➜ https://developer.nexaguard.com


    © 2025 NexaGuard Inc. All rights reserved.

    Previous
    iOS Setup
    Next
    Web Setup