For the complete documentation index, see llms.txt. This page is also available as Markdown.

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")
 self.appConsent = [[ACNotice alloc] initWithAppKey:@"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)
[self.appConsent presentSettingsWithViewController:self];
appConsent.consentGiven()
BOOL consentStatus = [appConsent consentGiven];

Return true if consent is given, false otherwise.

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

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:

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

Implement AppConsentDelegate in your header ile (.h)

Assign ACNotice delegate to self

Then implement the delegate methods in your implementation file (.m) as per below

Full implementation ViewController implementation

ExampleObjcViewController.h

ExampleObjcViewController.m

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

Conform your ViewModel to AppConsentDelegate as per below

Add 2 published properties on your ViewModel in order to react on delegates

Full View Model implementation

SwiftUI View implementation AppConsentViewModel to receive delegates events

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.

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

Not available

GCM Status

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 documentation

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

Example:

Return GCMStatus

Example:

Return GCMObjCStatus

Last updated