1. Overview
consentmanager SDK is a comprehensive solution for managing user consent in mobile applications. Designed to handle GDPR compliance, user privacy preferences, and ad tracking transparency, this SDK provides a seamless integration for iOS and Android platforms. Additionally, it offers wrapper plugins/bridges for React Native, Flutter, and Unity, making it versatile across various development environments.
This document covers the installation procedure and features made available to clients developing apps with Unity to access our consent management CMP SDK via the Unity C# Native Bridge. For further details about the underlying native SDKs, please refer to our iOS and Android API Documentation pages.
The Unity package contains a Demo Scene (ConsentManagerDemo) with a simple implementation that showcases the most common use cases of the consent management procedures inside a Unity mobile app.
2. Installation
2.1 Steps — High-level description
- Integration and configuration: Integrate the SDK into your mobile app, then configure the SDK settings according to your needs.
- Create an instance and display the consent layer: On app startup, create an instance of the
CMPManagerclass. This instance handles the consent process. The SDK automatically displays the consent screen if needed. - Process user consent data: Once consents are collected, the information is stored and available for querying through different properties and methods exposed by the SDK. You’ll have information about rejected or accepted consents, vendors, and purposes.
2.2 Compatibility
- Unity 20XX.X.X or later (note: there are known vulnerabilities in earlier Unity versions)
- iOS (via
DllImport) - Android (via JNI)
2.3 Importing the SDK package
Make sure your build.gradle file inside the Android folder of your project declares the proper dependency. This is a Unity C# Native Bridge, so both dependencies must be in sync. The same applies for iOS: make sure your podspec file reflects the proper dependency, as shown below.
- Download the latest release of the plugin.
- Import the package into your Unity project via Assets › Import Package › Custom Package.
- You’ll see the
ConsentManagerSDKfolder inside theAssetsfolder in the project structure on the Unity Editor. - Switch to your chosen platform, build the solution, and open the generated project in the respective IDE of your choice.
2.4 Platform-specific setup
iOS
- Set the XCFramework as a dependency, using either CocoaPods or SPM.
- Add
cm-sdk-ios-v3to the Unity-iPhone and UnityFramework targets in the Frameworks and Libraries section of Xcode.
Android
- Set the Android SDK as a dependency in the
build.gradlefile at the:unityLibrarymodule level:
implementation 'net.consentmanager.sdkv3:cmsdkv3:3.6.0'