Step 2: Basic Integration
How to use AppConsentUnified
1. Get your AppKey
The first step is to create your source / notice and retrieve your generated YOUR_APP_KEY from AppConsent : https://app.appconsent.io

2. Initialise AppConsentUnified
The second step is to initialise the SDK Our AppConsentUnified iOS SDK supports the following target:
iOS, (iPhone, iPad and macOS through mac Catalyst) minimum deployment target 13.0
Our AppConsentUnified framework is built in Swift and UIKit, and supported integration within a Swift and Objective-C app. It is possible to use within a SwiftUI app following various approaches (one of them is in the example below)
INFO AppConsentUnified SDK supports the new App Tracking Transparency framework (> iOS 14+ available). You must register the NSUserTrackingUsageDescription key in your Info.plist of your application otherwise your app will crash. See App Tracking Transparency for details.
INFO
In the example below, the code focuses on using the SDK exclusively.
INFO In the example below, the code focuses on using the SDK exclusively.
First import our Swift header declaration
If you are mixing Swift + Objective-C you will need to important as well your "App-Swift.h" file.
For example:
Once this is done, here below a basic implementation:
Create a property ACNotice in your implementation file (.m)
INFO Our SDK is developed with UIKit therefore it requires some adjustments for SwiftUI. For this example below we showcased an integration using top keyWindow. In order to achieve it, some extension class have been created. You can other ways of integrating our SDK, for example using UIViewRepresentable.
(Optional) First create a ViewModel in order to encapsulate all business logic from our SDK into a view model that conform to observable protocol. Later this object will be use within the view
(Optional) If you are using Scene Delegate or Scenes, then (if not already done on your end) create a small extension in order to be able to grab the proper keyWindow.
Your final View should looks like this and is fully implemented
Last updated