Vendors Helpers

OneTrust SDK Public Methods for IAB and Google Vendors

Existing

Group consent action for all vendors based on mode

Updates consent status for all the vendors locally, based on the mode passed.

Parameters:

  • isSelected: Pass true/false to update all vendor consent to 1/0 locally.
  • mode: The mode of the Vendor List. If no mode is passed, we will consider it as IAB by default.
OTPublishersHeadlessSDK.shared.updateAllVendorsConsentLocal(\_:, for:)

Update consent for an individual vendor

Updates the consent status for a specific vendor locally.

Parameters:

  • vendorID: The vendor identifier for which the consent status needs to be updated.
  • consentStatus: Updated consent status.
  • mode: The mode of the Vendor List. If no mode is passed, we will consider it as IAB by default.
OTPublishersHeadlessSDK.shared.updateVendorConsent(vendorID:, consentStatus:, for:)

Update legitimate interest for an individual vendor

Updates the legitimate interest status for the specified vendor.

Parameters:

  • vendorID: The vendor identifier for which the LI status needs to be updated.
  • legIntStatus: Updated legitimate interest status.
  • mode: The mode of the Vendor List. If no mode is passed, we will consider it as IAB by default.
OTPublishersHeadlessSDK.shared.updateVendorLegitInterest(vendorID:, legIntStatus:, for:) {

Note: Legitimate interest is supported only for IAB vendors.

New (from 202504.1.0)

Get UI styling associated with Vendors List UI

Retrieves all the Vendor List and Vendor Details UI styling related data.

OTPublishersHeadlessSDK.shared.getVendorsListUIStylingData()

Note: The general property will contain all the vendor list UI data and the detailsUIData will contain all the vendor details related UI Data.

Get all active vendors and their details associated with a mode

Returns all the active vendors associated with the passed in mode using CMP API Data.

Parameters:

  • mode: The vendor mode for which the vendors need to be retrieved.

Returns:

  • List of dictionaries where key represents the vendor identifier and the value represents the vendors protocol.
OTPublishersHeadlessSDK.shared.getAllVendors(mode:) -> [String: VendorsInfoProtocol]?

Note: The vendors protocol can be type casted as publicly exposed IAB/Google/General vendors from OTSDK for more individual properties specific to the vendor type.

Get details of an individual vendor

Retrieves all the vendor details associated with the passed in vendor identifier and the vendor mode.

Parameters:

vendorId: The vendor identifier for which the details need to be retrieved.

mode: The vendor mode associated with the vendor (IAB/Google/General).

OTPublishersHeadlessSDK.shared.getVendorDetails(vendorId:, for:) -> VendorsInfoProtocol?

Return:

  • A vendor protocol which can be type casted as publicly exposed IAB/Google/General vendors from OTSDK for more individual properties specific to the vendor type.

Deprecated (starting 202504.1.0)

Retrieves all the active vendors associated with the passed in mode

OTPublishersHeadlessSDK.shared.getVendorListData(for:) -> [String : Any]?

Parameter:

  • mode: The mode of the Vendor List. If no mode is passed, we will consider it as IAB by default.

Deprecation Message: This method will be removed in a couple of releases. Moving forward, please use getAllVendors(mode:) to get all the active vendors associated with the passed in mode.

Retrieves the local state of all the active vendors belonging to the passed in mode.

Parameter:

  • mode: The mode of the Vendor List. If no mode is passed, we will consider it as IAB by default.
OTPublishersHeadlessSDK.shared.getVendorListUI(for:) -> [String : Any]?

Return:

  • A dictionary containing local state of active Vendor List if values are updated without save using updateVendorConsent/updateVendorLegitInterest.
  • Saved Vendor state stored if nothing changed.
  • Nil if none found.

Deprecation Message: This method will be removed in a couple of releases. Moving forward, please use getAllVendors(mode:) to get all the active vendors associated with the passed in mode.

Retrieves all the vendor details for given vendor id and given vendor mode.

Parameter:

  • vendorID: The vendor identifier for which the details needs to be retrieved.
  • mode: The mode of the Vendor List. If no mode is passed, we will consider it as IAB by default.
OTPublishersHeadlessSDK.shared.getVendorDetails(vendorID:, for:) -> [String : Any]?

Deprecation Message: This method will be removed in a couple of releases. Moving forward, please use getVendorDetails(for:mode:) to get the vendor details associated with the passed in vendor identifier.