Android & Android TV: Events
Sibbo custom events
The CMP launches a custom event to detect the following:- The CMP has been closed ('sibbo-close' event)
Kotlin Example:
Create CMP variable :
lateinit var CMP: ConsentHelper
Initialize CMP with your context.
-
CMP = ConsentHelper(YourContext)
Use setOnTryOpenListener to run code before the CMP appear. Inside success boolean will indicate whether the CMP will appear or not.
- CMP.setOnTryOpenListener { success ->
- //Your code
- }
Use setOnCloseListener to run code after the CMP has been closed:
- CMP.setOnCloseListener ( success -> {
- //Your code
- });
Java Example:
Create CMP variable :
- private ConsentHelper CMP;
Initialise CMP with your context:
- 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.
-
CMP.setOnTryOpenListener ( success -> {
- //Your code
- });
Use setOnCloseListener to run code after the CMP has been closed:
- CMP.setOnCloseListener( ( ) -> {
- //Your code
- });