[Unity] 1. consentmanager SDK Integration
Consent Management Platform (CMP) Unity Plugin
The Consent Management Platform (CMP) Unity Plugin allows you to easily integrate Consent Management functionality into your Unity applications for handling user consent and privacy preferences.
- Supports both iOS and Android platforms.
- Provides a bridge between Unity and native platform-specific CMP functionalities.
- Allows you to initialize, manage user consent, and handle privacy-related data.
- Download the latest release of the plugin.
- Import the package into your Unity project using Assets > Import Package > Custom Package.
In order to use the Unity SDK please follow these steps.
For iOS you just to be sure that the
CmpSdk.xcframeworkis added accordingly to the unity Project.
Typically for the
Unity-iPhonetarget the xcframework should be added as
UnityFrameworkyou have to add the xcframework as
Link Binary With Libraries.
Follow these steps to start using the plugin.
- Initialization: To use the CMP functionality, initialize the CMPManager instance.
CmpManager.Instance.Initialize(domain, codeId, appName, language);
- Consent Layer: Display the consent layer using the following:
- Check Consent: Check if the user has given consent:
bool hasConsent = CmpManager.Instance.HasConsent();
- Callbacks: Set callback listeners for various events:
CmpManager.Instance.SetIOSCallbacks(openListener, closeListener, cmpNotOpenedCallback, onErrorCallback, onCmpButtonClickedCallback);
- Purpose and Vendor Checks: Check for consent related to specific purposes and vendors:
bool hasPurpose = CmpManager.Instance.HasPurpose(id); bool hasVendor = CmpManager.Instance.HasVendor(id);
- Export Data: Export CMP data:
string cmpString = CmpManager.Instance.ExportCmpString();
- Documentation: For detailed API documentation and usage examples, refer to the official documentation.
- Unity 20XX.X.X or later
- iOS (via DllImport)
- Android (via JNI)
For bug reports, feature requests, or general inquiries, please open an issue on the repository.
This plugin is licensed under the MIT License.
Created and maintained by Skander Ben Abdelmalak.