iOS CMP

iOS CMP Integration Manual

1. Overview

SDK provides an optional Consent Collection feature or CMP. The SDK currently implements TCF v2. The TC string generated by the SDK is available to callers and can be found in the standard location as per TCF v2 specification.

2. Before you start

2.1. Add SDK to your project with CocoaPods

Add CMP pod to your Podfile
pod 'YieldloveConsent', '6.2.0'
Install
$ pod install

Receive an APPLICATION_NAME for the app, where you would like to collect consent from users. Set the application name:

Set application name
YLConsent.instance.setAppName(appName: "APPLICATION_NAME")

2.2. Add SDK to your project with Carthage

  1. In your Cartfile add these dependencies (for more info about Cartfile see: https://github.com/Carthage/Carthage):

  2. Run carthage update --use-xcframeworks --platform ios

  3. Link downloaded and built .xcframeworks to the project

Simple Consent Message displays a view that contains legal information about how user data are collected and handled. It has two buttons, “Accept All” and “Manage My Options” (exact wording may vary and may appear translated).

To collect consent in this manner call YLConsent.instance.collect()

To react to user actions and manage your app UI use a class that implements ConsentDelegate protocol and listen for onConsentReady(consents: SPUserData) callback. To use this method please import ConsentViewController. If it returns, a consent has been given, and app can resume; it will also contain the consent information returned by SourcePoint. See Reacting to App User Actions for details on how to implement this. Pass ConsentDelegate as second argument to YLConsent.instance.collect().

NOTE: Depending on settings of CMP feature for your app, which are done outside the SDK, Simple Consent Message might not appear if consent has already been given by the user in the past. In such case, calling this method again after consent was provided will NOT show the Simple Consent Message.

4. Privacy Manager

Privacy Manager displays a more detailed view, where user can consent to individual purposes of their data collection and handling, and choose to share their data with specific vendors. Usually it is the same view that is also accessible using “Manage My Options” button in the Simple Consent Message view.

To display Privacy Manager call YLConsent.instance.showPrivacyManager()

Display Privacy manager in Swift
Display Privacy manager in Objective-C

To react to users actions and manage your app UI use a class that implements ConsentDelegate protocol and listen for onConsentReady(consents: SPUserData) callback. To use this method please import ConsentViewController. If it returns, a consent has been given, and app can resume; it will also contain the consent information returned by SourcePoint. See Reacting to App User Actions for details on how to implement this. Pass ConsentDelegate as a second argument to YLConsent.instance.showPrivacyManager().

5. Support for PUR layer

To show PUR layer, pass variant parameter into ConsentOptions object and call collect() or showPrivacyManager(). Ask publisher account management for the value of this property.

Pass variant to Privacy manager

Passing a variant will display a different view in the CMP. App will still get notifications through the consentDelegate, as if it was a usual simple message or privacy manager flow.

6. Reacting to App User Actions

After user makes their choices “dismiss” method is called by the SDK on the view controller that was passed into the API call:

Dismiss method signature

with values dismiss(animated: true, completion: nil)

This dismisses the view controller that was presented modally and causes the view to disappear, allowing user to carry on using your app. If you do not present the Simple Consent Form or Privacy Manager modally, in a “pop-up” kind of way, you may need to navigate the user back to some other view after they make their choices.

To do this, have a class implement ConsentDelegate protocol, specifically onSPUIFinished() method. SDK will call this method every time the user finishes making their choices, either using Simple Consent Message or Privacy Manager.

For example:

ConsentDelegate implementation in Swift
ConsentDelegate implementation in Objective-C

Then pass this class into the delegate property to the API calls. For example:

or

Show Privacy manager with delegate

Currently the SDK implements the following delegate methods (listeners):

Delegate methods

Additionally, onAction(action: SPAction) can be called where action is one of:

To clear a previously stored consent this method is available:

7.1. Programmatically consenting a user

This API method is forwarding to the SourcePoint method customConsentTo. The ids passed will be appended to the list of already accepted vendors, categories and leg. int. categories. The method is asynchronous so you must pass a completion handler that will receive back an instance of GDPRUserConsent in case of success or it’ll call the delegate method onError in case of failure.

It’s important to notice, this method is intended to be used for custom vendors and purposes only. For IAB vendors and purposes, it’s still required to get consent via the consent message or privacy manager.

Please refer to the original manual in the SourcePoint documentation for more information

If you want to use Authenticated Consent feature, pass authId parameter into ConsentOptions object and call collect().

Currently we do not support Authenticated consent for the Privacy manager flow. Even though is it possible to specify authId in ConsentOptions, calling showPrivacyManager(: UIViewController, : ConsentDelegate, : ConsentOptions?) will not cause authenticated consent to be used.

Change log

6.1.0 (17.2.2023)

This is a maintenance release which includes version 7.0.1 of SourcePoint CMP.

6.0.1 (26.10.2022)

API breaking changes:

The following API methods are removed:

  • collect(: UIViewController, : ConsentDelegate)

  • collect(: UIViewController, : ConsentDelegate, : String?)

  • showPrivacyManager(: UIViewController, : ConsentDelegate, : String?)

  • showPrivacyManager(: UIViewController, : ConsentDelegate, : SPMessageLanguage, : String?)

Instead, please use these API methods:

  • collect(: UIViewController, : ConsentDelegate, : ConsentOptions?)

  • showPrivacyManager(: UIViewController, : ConsentDelegate, : ConsentOptions?)

Please see respective section of the manual for description of the ConsentOptions object.

5.1.3 (5.9.2022)

Fixes bug regarding storing of given consent

5.1.2 (25.8.2022)

Fixes a bug where SDK would sometimes attempt to present a viewController while it was already being presented, causing the app to crash

5.1.0 (1.7.2022)

update external configuration sdk

5.0.0 (22.6.2022)

Breaking change: Renamed class YieldloveConsent to YLConsent

4.9.16 (10.6.2022)

remove Alamofire dependency

4.9.0 (20.5.2022)

solve compiler version warning

4.7.1 (1.4.2022)

Fix dependencies

4.7.0 (30.3.2022)

Add language support

4.6.1 (1.2.2022)

Update external config SDK version.

4.5.3 (27.1.2022)

Maintenance release that includes YL External Configuration 0.9.1 and is compatible with YL AdIntegration 7.1.1

4.3.0 (3.12.2021)

Updated Sourcepoint CMP library to version 6.3.1

4.2.1 (26.11.2021)

Fixed a bug where onConsentReady(consents: SPUserData) was not called on publisher’s delegate.

4.2.0 (26.11.2021)

Maintenance release. Upgrade to latest version of external configuration dependency.

4.1.0 (4.11.2021)

Support for Xcode 13 in Carthage module. Minimum iOS version is now 11.

4.0.0 (27.10.2021)

Updated SourcePoint ConsentViewController library to version 6.2.0, the official changelog can be found here

API breaking changes:

  • In the ConsentDelegate class the following functions have been updated:

    • onConsentReady(: GDPRUUID, : GDPRUserConsent) changed to onConsentReady(: SPUserData)

    • gdprConsentUIWillShow() changed to onSPUIReady()

    • consentUIDidDisappear() changed to onSPUIFinished()

New Feature:

  • Support for multi campaigns

  • Added callback method onAction to the delegate to forward certain supported action by SourcePoint

    • SPActionType.AcceptAll

    • SPActionType.RejectAll

    • SPActionType.ShowPrivacyManager

    • SPActionType.SaveAndExit

    • SPActionType.Dismiss

    • SPActionType.PMCancel

    • SPActionType.RequestATTAccess

    • SPActionType.IDFAAccepted

    • SPActionType.IDFADenied

    • SPActionType.Unknown

3.3.1 (11.10.2021)

Fixed Carthage deployment.

3.3.0 (7.10.2021)

Different variants of Privacy Manager UI can be now configured and shown to app users by passing variant property to showPrivacyManager() API method

3.2.1 (29.9.2021)

Build for backward compatibility

3.2.0 (29.9.2021)

Add support for AuthId

3.1.0 (9.8.2021)

Upgrade Alamofire to v5

3.0.3 (22.7.2021)

Maintenance release. Changed project structure.

3.0.2

Bumped YieldloveExternalConfiguration dependency to 0.4.0

3.0.1

Add Objective-C support

3.0.0

API breaking changes:

  • In collect(: UIViewController, : ConsentDelegate) and showPrivacyManager(: UIViewController, : ConsentDelegate) methods the second parameter delegate is now mandatory

  • Dropped manual configuration support for setting consent properties, only External Configuration is supported

New supported API Method:

  • Added a new method to clear the previously stored consent: clearConsentData(: ConsentDelegate)

Bugfixes:

  • The method customConsentTo() correctly invokes the completionHandler

2.1.2

  • Minimum iOS version is now iOS 10

2.1.0

  • Stability improvements and fixes to Consent and PM

2.0.0

API breaking changes:

  • onConsentReady now passes through the consent information received from SourcePoint, the signature of the method has changed