ConsentUtils

public class ConsentUtils

Utility class for retrieving consent information in compliance with various standards.

This class provides methods to retrieve consent strings and check GDPR applicability.

IAB TCF String Documentation Google Additional Consent String Documentation US Privacy String Documentation

  • Retrieves the IAB Transparency and Consent Framework (TCF) string.

    Declaration

    Swift

    public static func getTCString() -> String?

    Return Value

    The TCF string, or nil if not available.

  • Retrieves Google’s Additional Consent string.

    Declaration

    Swift

    public static func getACString() -> String?

    Return Value

    The additional consent string, or nil if not available.

  • Retrieves the US privacy string.

    Declaration

    Swift

    public static func getUSPrivacy() -> String?

    Return Value

    The US privacy string, or nil if not available.

  • Retrieves an integer indicating if GDPR legislation applies.

    Declaration

    Swift

    public static func getGDPRApplies() -> Int?

    Return Value

    An integer representing GDPR applicability, 0 if not applies, 1 if applies and -1 if not available

  • Checks if the given vendorId has consent under the IAB TCF. TCF Vendor List

    Declaration

    Swift

    public static func hasTCConsent(vendorId: Int) -> Bool?

    Parameters

    vendorId

    The vendor ID of IAB TCF.

    Return Value

    True if the vendor has consent in IAB , false otherwise, or null if not available.

  • Checks if the given vendorId has consent for additional consent under Google guidelines.

    Declaration

    Swift

    public static func hasACConsent(vendorId: Int) -> Bool?

    Parameters

    vendorId

    The vendor ID for additional consent by Google check.

    Return Value

    True if the vendor has additional consent by Google, false otherwise, or null if not available.