Step 3: Advanced Integration


How to use appConsent object ?

Specify a dedicated endpoint at init

let appConsent = ACNotice(withAppKey: "YOUR_APP_KEY", dedicatedEndpointURL: "YOUR_BACKEND_ENDPOINT")

Redirecting user to their Privacy Settings

This screen displays the user consent details and allows granular control, enabling users to provide consent for each individual item. User can also modify existing consent in that settings page.

appConsent.presentSettings(viewController: self)
appConsent.consentGiven()

Return true if consent is given, false otherwise.

triangle-exclamation

When the user has completed the consent process and given their consent, this delegate informs you whether our CMP did finish successfully or did fail. Depending on these delegate you can trigger some action on your end depending on your business logic

circle-info

INFO

In the example below, we start with the previous basic example found at Step 2: Basic Integration

Assign ACNotice delegate to self

Add an extension to your ViewController that conform to that Delegate

Full View Controller implementation:

Check for update

This method allows you to check from our servers whether your Notice has been updated since it was last displayed on your user's device.

circle-info

INFO

The method will return true if you have modified the Source and/or Notice from your dashboard and, if and only if, you have configured your Notice to update for all your users.

Our latest SDK supports both traditional callback-based APIs and the modern Swift concurrency approach using async/await for most methods. Check for update - callback-based

Check for update - Modern concurrency

GCM Status

circle-info

INFO

This method shows the current status of GCMv2 (Google Consent Mode V2).

Before calling up this method, it's best to make sure that the user has already given his consent and that it's up to date, and that the CMP doesn't need to be redisplayed.

Otherwise :

  • either the saved value of the old consent will be returned

  • or the default values of your FirebaseAnalytics Info.plist configuration file will be returned

Set the default consent state from google documentationarrow-up-right

ℹ️ As some annotations are not compatible with Objective-C, we do have separate method for Objective-C and Swift.

Example:

Return GCMStatus

Last updated