Develop

Consent package

Updated: Sep 4, 2026
The Platform SDK Consent Package provides APIs to check the status of different consent types and launch consent flows when required. The package retrieves consent status to determine if users have seen, approved, or declined consent requests, and launches platform consent UI when explicit user agreement is needed.
Different consent statuses are supported including not seen, seen, consented, and withdrawn states. This package enables compliance with privacy regulations and platform policies for features requiring user consent.

Before you begin

How to install

  1. Add the following to your project’s ./gradle/libs.versions.toml file:
     [libraries]
     # Existing lines
     consent-kotlin = { module = "com.meta.horizon.platform.sdk:consent-kotlin", version.ref = "horizonPlatformSdk" }
    
     dependencies {
         // Existing lines
         implementation(libs.consent.kotlin)
     }
    
  2. In Android Studio, click File > Sync Project with Gradle Files to install the package.
  3. Click Build > Generate App Bundles or APKs > Generate APKs.
  4. In the “External Libraries” section of your project, confirm that these packages are listed.
     com.meta.horizon.platform.sdk:core-kotlin
     com.meta.horizon.platform.sdk:consent-kotlin
    
    Now you can initialize the Platform SDK and use Consent package functions in your app.

API reference

See the exact requests and responses in the Platform SDK Consent Package.

Test this on Meta Spatial Simulator

getConsentStatus and the outcome of launchConsentIfRequired:
These APIs are available on Meta Spatial Simulator, with one caveat worth knowing before you rely on the result: they return a fixed response rather than evaluating what you send. A call that would fail on a physical device still returns a success response here. Use the simulator to check your integration compiles and handles a response, and confirm the decision itself on a physical device.
The launchConsentIfRequired call, which shows a consent dialog before returning that fixed outcome. The dialog is informational, and the outcome is the same whatever you do with it:
These use a simulated dialog.