Skip to content

Manual TCF processing Android

Manual processing uses the setCustomConsent method. It takes a string in the INFOnline Consent String Notation, not the CMP's TC string.

When the consent must be set
  • Call setCustomConsent directly after initialising the session (initIOLSession), before the first event. Called before initialisation, it throws a NullPointerException.
  • When the session is terminated (terminateSession), the IOLib resets the value. Set it again after every restart with startSession().
  • The IOLib discards events without valid consent before sending (see Effect on measurement).

For measurement in Austria (ÖWA), use the session type IOLSessionType.OEWA instead of IOLSessionType.SZM in all calls.

Example:

1
2
3
IOLSession session = IOLSession.getSessionForType(IOLSessionType.SZM);
// set custom consent:
session.setCustomConsent("<CUSTOMCONSENT>"); // see INFOnline Consent String Notation

Priority of automatic processing

The IOLib prioritises automatic processing over manual processing. If automatic processing produces a valid IO consent string, that string is transmitted and the manual one is ignored. As of version 2.5.0 you can force manual processing.

Checking

The getConsent method returns the IO consent string currently used for transmission.

1
2
IOLSession session = IOLSession.getSessionForType(IOLSessionType.SZM);
session.getConsent();

Whether the IOLib discards events for missing consent is only shown in debug mode.


Last update: October 23, 2026