Madex
  • Android SDK
    • Installing and configuring the SDK
    • Working with advertising
    • User Consent Screen
    • Adapters for other SDKs
      • Applovin MAX SDK
      • IronSource SDK
    • Change Log
  • iOS SDK
    • Installing and configuring the SDK
    • Working with advertising
    • User Consent Screen
    • Adapters for other SDKs
      • Applovin MAX SDK
      • IronSource SDK
    • Change Log
  • Unity Plugin
    • Installing and configuring the plugin
    • Working with advertising
    • User Consent Screen
    • Adapters for other SDKs
      • Applovin MAX SDK
      • IronSource SDK
    • Change log
  • Cordova Plugin
    • Installation and configuration the plugin
    • Working with advertising
    • Change Log
  • Construct3 Addon
    • Addon installation and configuration
    • Installation and configuration of Madex mediation addon
    • Working with advertising
Powered by GitBook
On this page
  • General Information
  • Consent screen and Consent Manager
  • Demo Application
  • Installation
  • Prepare Gradle
  • Setting up Consent Manager
  • Working with Consent Manager
  • Initialization
  • Displaying the Permissions Request Screen
  • Checking the User's Consent Status
  • Updating the User's Consent Status (SDK method for advertising)
  • Debug Mode
  • Event Tracking
  1. Android SDK

User Consent Screen

Library for demonstrating a ready-made consent screen for the collection, processing, and usage of user data.

Release Version 1.2.1 | Release Date 7/15/2024

Minimum requirements:

  • Use the Android API level 22 (Android OS 5.1) and above.

The information provided below is not legal advice. Madex is not responsible for the consequences of its use. Before making legally significant decisions, it is recommended to consult with a lawyer.

General Information

To comply with the requirements of app stores and laws regulating the collection, processing, and usage of user personal data, obtaining the user's consent for the mentioned actions is required. If refused, no user data should be collected.

In addition to user consent, you will need to properly prepare a privacy policy and other documents required by app stores and the laws of the countries where your app is published.

Clear consent for the collection, processing, and usage of user data is required by most countries. Here are a few key documents describing this process:

  • GDPR (General Data Protection Regulation, Regulation (European Union) 2016/679)

  • COPPA (Children's Online Privacy Protection Rule)

  • CCPA (California Consumer Privacy Act)

Please note that this list is not exhaustive. It is recommended to study the legislation regulating user personal data in the countries where your app is published and consult with a lawyer before making legally significant decisions.

Consent screen and Consent Manager

Usually, user consent is obtained on a special screen during the first launch of the app — the consent screen.

Madex SDK implements such a screen, and you can add and customize it using the Consent Manager library. You can use it to avoid creating the Consent Screen yourself.

Demo Application

Use our demo application as an example.

Installation

Prepare Gradle

  1. Add the dependency for installing Consent Manager to the build.gradle file.

dependencies {
    // ... other dependencies
    
    // connection of Consent Manager SDK dependency
    implementation 'sspnet.tech.consent:madex:1.2.1'
}
  1. Save the file and click on Gradle sync.

Setting up Consent Manager

Before using the user consent screen, it needs to be configured.

To set parameters, call the methods of the builder variable. Below is a list of all available settings:

  • appendPolicyURL - sets the link to your app's privacy policy. Consider this parameter as mandatory. Links to Madex's and our partners' privacy policies are already added to the consent screen.

  • appendBundle - sets a custom Bundle used to set the app's icon in the TopBar of the user consent screen. If the parameter is not filled, the existing app icon will be displayed.

  • appendName - sets the name of your app in the TopBar of the user consent screen. If the parameter is not filled, the existing app name will be displayed.

Take a look at the complete example of setting parameters:

final ConsentBuilder builder = new ConsentBuilder()
        .appendPolicyURL("https://madex.me/privacy-policies")
        .appendGDPR(true)
        .appendBundle("me.madex.ads.app")
        .appendName("Example name");
        
consentManager.registerCustomVendor(builder);

Working with Consent Manager

Initialization

Create a ConsentManager variable in your Activity.

final ConsentManager consentManager = new ConsentManager();

We recommend calling SDK initialization in your MainActivity - in the onCreate method.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    
    consentManager.loadManager();
}

Displaying the Permissions Request Screen

To display the screen, call the showConsentWindow method.

consentManager.showConsentWindow();

Checking the User's Consent Status

If the user has given consent to data collection, the method will return true.

consentManager.hasConsent(this);

If the method returns false, it is strongly recommended not to collect any data about this user.

Updating the User's Consent Status (SDK method for advertising)

To update the consent status in the Madex SDK (for advertising purposes), use the setUserConsent method.

Madex.setUserConsent(consentManager.hasConsent(this));

Debug Mode

If you need error and event logging, enable debug mode. By default, it is turned off.

To enable debug mode, use the enableDebug method.

consentManager.enableDebug(true);

Event Tracking

Consent Manager allows you to track events related to user consent for data collection.

To track events, provide a class to work with.

Below is an example of setting up advertising events.

consentManager.setListener(new ConsentListener() {
    @Override
    public void onConsentManagerLoaded() {
        // Called when the manager is ready to show
    }
    
    @Override
    public void onConsentManagerLoadFailed(String error) {
        // Called if there is an error during loading
    }
    
    @Override
    public void onConsentWindowShown() {
        // Called when the screen is displayed
    }
    
    @Override
    public void onConsentManagerShownFailed(String error) {
        // Called if there is an error during screen display
    }
    
    @Override
    public void onConsentWindowClosed(boolean hasConsent) {
        // Called when the screen is closed
        // hasConsent - determines whether the user has given consent
    }
});
PreviousWorking with advertisingNextAdapters for other SDKs

Last updated 5 months ago

Install Madex SDK. Detailed installation process is described in the .

appendGDPR - adds a button for refusing data collection. Consent screen with one button: the option to refuse data collection is available to the user only through device settings. Consent screen with two buttons: the option to refuse data collection is available to the user by tapping the "No thanks" button.

Other Madex SDK methods (for working with ads) can be found in the .

corresponding section
GitHub - MadexTech/madex-android-demoGitHub
Logo
corresponding section