CMPProvider
public protocol CMPProvider
A protocol representing a CMP (Consent Management Platform) provider. This protocol provides an interface to automate the consent gathering process when using a CMP.
-
Required empty constructor to instantiate implementations via reflection.
Declaration
Swift
init()
-
Returns the name of the CMP.
Declaration
Swift
func getCMPName() -> String
-
Returns the version of the CMP’s SDK.
Declaration
Swift
func getCMPVersion() -> String
-
Determines if we already have gathered the user’s consent and may continue with the ad mediation flow.
Declaration
Swift
func canRequestAds() -> Bool
-
Returns true if the CMP has a form available to show to the user, false otherwise.
Declaration
Swift
func isPrivacyFormAvailable() -> Bool
-
Requests the CMP to update the consent requirements for this user. This gives the opportunity for the CMP to determine which regulations affect the user, and to load the consent from previous sessions if available.
Declaration
Swift
func requestConsentRequirementsUpdate(params: CMPParams, onComplete: @escaping (CMPError?) -> Void)
-
Displays the required consent forms if any and notifies using a callback upon completion.
Declaration
Swift
func gatherConsentIfRequired(viewController: UIViewController, onComplete: @escaping (XMediator.CMPError?) -> Void)
-
Presents the privacy form if available.
Declaration
Swift
func presentPrivacyForm(viewController: UIViewController, onComplete: @escaping (XMediator.CMPError?) -> Void)
-
Resets the user’s consent (debug only).
Declaration
Swift
func reset()