Android & Android TV: Events

Android & Android TV: Events


Sibbo custom events


The CMP launches a custom event to detect the following:
  1. The CMP has been closed ('sibbo-close' event)

Kotlin Example:

Create CMP variable :

lateinit var CMP: ConsentHelper

Initialize CMP with your context.

  1. CMP = ConsentHelper(YourContext)

Use setOnTryOpenListener to run code before the CMP appear. Inside success boolean will indicate whether the CMP will appear or not.
  1. CMP.setOnTryOpenListener { success ->
  2.     //Your code
  3. }

Use setOnCloseListener to run code after the CMP has been closed:
  1. CMP.setOnCloseListener ( success -> {
  2.     //Your code
  3. });


Java Example:


Create CMP variable :
  1. private ConsentHelper CMP;

Initialise CMP with your context:
  1. CMP = new ConsentHelper(YourContext)


Use setOnTryOpenListener to run code before the CMP appear. Inside success boolean will indicate whether the CMP will appear or not.
  1. CMP.setOnTryOpenListener ( success -> {
  2.     //Your code
  3. });

Use setOnCloseListener to run code after the CMP has been closed:
  1. CMP.setOnCloseListener( ( ) -> {
  2.     //Your code
  3. });