[Unity] 1. consentmanager SDK Integration
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 our clients developing apps with Unity to have access to our consent management CMP SDK via our Unity C# Native Bridge. For further details, please refer to our API Reference documentation. Our 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
1. Steps - High Level Description
-
Integration and Configuration:
- Integrate the SDK into your mobile app.
- Configure the SDK settings according to your needs.
-
Creating an Instance and displaying the Consent Layer:
- On app startup, create an instance of the
CMPManager
class. This instance will handle the consent process. - The SDK will automatically display the consent screen if needed.
- On app startup, create an instance of the
-
Processing user's consent data:
- Once consents are collected, info is stored and is available for querying through different properties and methods exposed by our SDK. You'll have information about rejected or accepted consents, vendors and purposes.
In terms of compatibility, we have:
- Unity 20XX.X.X or later
- iOS (via DllImport)
- Android (via JNI)
2. Importing the SDK package
Make sure that your build.gradle
file inside the Android folder of your project has the proper dependency declared. 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, like 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 folder ConsentManagerSDK inside the Assets folder in the project structure on Unity Editor
- Switch to the chosen platform, build the solution open the generated project on the respective IDE of your choice
- iOS
-
Android
- Set our Android SDK as a dependency in the build.gradle file inside the
:unityLibrary
module level:implementation 'net.consentmanager.sdkv3:cmsdkv3:3.2.0'
- Set our Android SDK as a dependency in the build.gradle file inside the