Skip to content

Manual TCF processing iOS

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
  • setCustomConsent only takes effect while the session is running. Call it directly after starting the session, before the first event.
  • The value only applies to the running session. Set it again after every session start.
  • The IOLib discards events without valid consent before sending (see Effect on measurement).

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

Objective-C

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
- (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions {
    [self startSession];
    // other code
    return YES;
}

- (void)startSession {
    // initialise the IOLib; session start
    // privacySetting LIN = Legitimate interest is given
    [[IOLSession defaultSessionFor:IOLSessionTypeSZM]
        startSessionWithOfferIdentifier:@"<offerIdentifier>"
        privacyType:IOLPrivacyTypeLIN];
    // set the consent directly after starting the session
    [[IOLSession defaultSessionFor:IOLSessionTypeSZM]
        setCustomConsent:@"<CUSTOMCONSENT>"]; // see INFOnline Consent String Notation
}

Swift

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
    startSession()
    // other code
    return true
}

func startSession() {
    // initialise the IOLib; session start
    // privacySetting LIN = Legitimate interest is given
    IOLSession.defaultSession(for: .SZM).start(withOfferIdentifier: "<offerIdentifier>", privacyType: .LIN)
    // set the consent directly after starting the session
    IOLSession.defaultSession(for: .SZM).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.7.0 you can force manual processing.

Checking

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

Objective-C:

[IOLSession defaultSessionFor:IOLSessionTypeSZM].consent;

Swift:

IOLSession.defaultSession(for: .SZM).consent()

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


Last update: October 23, 2026