Wiki

Clone wiki

madvertise-gdpr-cmp-android / cmp_migrate_v57

Migration guide to BlueStack CMP v57

This documentation will go through all the steps required to migrate to BlueStack CMP v57

Integration Guide

Update SDK File

Change the dependency to the latest SDK version number :

implementation 'com.madvertise:cmp-sdk:57.0.0'

New Step : Setup the SDK UI

Auto display mode :

Auto display of BlueStack CMP feature has been removed and you must now add another step to show it as shown below.

Manually display mode :

showManuallyCMP() method and setConsentManagerListener() callback has been removed from your Application Class and replaced by showCMP method in the onCreate method of your Activity as shown below.

Integration :

To collect the user consent, call the showCMP method in the onCreate method of your Activity.

ConsentManager.sharedInstance.showCMP(YourActivity, new OnConsentProvidedListener() {
            @Override
            public void consentProvided(String actionType) {

            }

            @Override
            public void consentFailed( String error) { 

            }
        });

Note :

  • The showCMP method takes the following parameters:

    • the current Activity.
    • a OnConsentProvidedListener interface to listen to changes of the consent signal.
  • The SDK will notify your listener OnConsentProvidedListener of all possible events listed below :

    • consentProvided(actionType: String) : A consent notice has been displayed to the user or the consent status has been synchronized. you can get the type of button which the user clicked. The actionType variable has one of the following values:

      • ConsentToolAcceptButton : The user has approved all vendors and all purposes displayed in the consent notice.
      • ConsentToolRefuseButton : The user has refused all vendors and all purposes displayed in the consent notice.
      • ConsentToolSettingsButton : The user has approved some vendors and/or some purposes displayed in the consent notice.
    • consentFailed(error: String): This method is called when an error occurs during initialisation or configuration of CMP.This method provides an string error that contains the reason of the failure.

  • The showCMP method must be called at each launch of your application to be sure to have an up-to-date consent status.

Advanced Topics

As per the GDPR regulation, publishers need to ensure the users can access and edit their consent choices through their application at any time.

Integration :

The openCMPUI method behaves the same way as the showCMP method but enforces the display.

ConsentManager.sharedInstance.openCMP(YourActivity,new OnConsentProvidedListener() {
                            @Override
                            public void consentProvided(@NotNull String actionType) {

                            }

                            @Override
                            public void consentFailed(String error) {

                            }
                        });
Note :
  • The openCMP method takes the following parameters:

    • the current Activity.
    • a OnConsentProvidedListener interface to listen to changes of the consent signal.
  • We recommend to expose a button to edit the consent in the application settings.

  • You can use this simple method : openCMP with the current Activity:

ConsentManager.sharedInstance.openCMP(YourActivity);

Updated