Wiki
Clone wikimadvertise-gdpr-cmp-android / cmp_third
Third-party Consent Manager
This documentation will go through all the steps required to used BlueStack CMP as third party consent ads without showing Popups.
Step 1: Import the BlueStack CMP SDK
In the main build.gradle of your project, you must declare the Bluestack repository:
allprojects { repositories { google() jcenter() // For All Bluestack SDKs (Mediation, CMP, Location) maven { credentials { username "madvertise-maven" password "GpdGZ9GE9SK7ByWdM987" } url "https://api.bitbucket.org/2.0/repositories/mngcorp/deploy-maven-bluestack/src/master" authentication { basic(BasicAuthentication) } } } }
In the build.gradle of to your application module, you can now import the Bluestack CMP by declaring it in the dependencies section:
implementation 'com.madvertise:cmp-sdk:57.0.0'
Step 2: Initialize the BlueStack CMP SDK
You have to init the SDK in your application class :
ConsentManager.sharedInstance.configureWithoutShowCmp(this, YOUR_APP_ID,YOUR_PUBLISHER_CC);
The configureWithoutShowCmp method takes the following parameters:
- the Application context.
- the App Id of your application.
- the publisherCC value (corresponds to the country code (Two-letter) of the country in which the publisher's business entity is established like "FR", "DE", "IT"...).
Step 3: Collect the user consent
You can generated IAB Transparency and Consent Framework (TCF V2) without Show MAdvertiseCMP Popups
- To save the state of accepting you can use the method :
ConsentManager.sharedInstance.acceptIABConsent();
- To save the state of refusing you can use the method :
ConsentManager.sharedInstance.refuseIABConsent();
Advanced Topics
Check if user accept or refuse the IAB Consent
This listener is called when the user accept or refuse the IAB Consent .
ConsentManager.sharedInstance.setOnTCFConsentStringDidChange(new OnTCFConsentStringDidChange() { @Override public void didAcceptAllTcfConsentString() { Toast.makeText(getActivity(),"Accept All TCF ConsentString",Toast.LENGTH_LONG).show(); } @Override public void didRefuseAllTcfConsentString() { Toast.makeText(getActivity(),"Refuse All TCF ConsentString",Toast.LENGTH_LONG).show(); } });
Updated