To simplify publishing your cookie banner and obtaining your visitor's consent, we've introduced a user-friendly Privacy Pillar Privacy Manager app, which you can integrate with your iOS mobile app.
Prerequisites:
Before integrating Privacy Pillar Privacy Manager, you must complete the following tasks.
# Comment the next line if you don't want to use dynamic frameworks use_frameworks! post_install do |installer| installer.generated_projects.each do |project| project.targets.each do |target| target.build_configurations.each do |config| config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0' end end end end # Pods for AdzapierCMPSDK pod 'DropDown' pod 'ConsentViewController', '6.7.0' pod 'IHProgressHUD' pod 'SwiftLint' pod 'IQKeyboardManagerSwift' pod 'XLPagerTabStrip' end
import UIKitimport AdzapierCMPSDKclass ViewController: UIViewController { @IBOutlet weak var btnCMPSDKAction: UIButton! @IBOutlet weak var lblConsentString: UILabel! public var consentString: String? override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. self.btnCMPSDKAction.addTarget(self,action: #selector(self.navigateToCMPSDK), for: .touchUpInside) /* After submitting consents consent string will receive in below mention callback printValue which will get dictionary object with key consent_string parameter that can be used in for display purpose or tracking purpose */ NotificationCenter.default.addObserver(self, selector: #selector(printValue), name: NSNotification.Name(rawValue: "printValue"), object: nil) } @objc func printValue(notification:NSNotification) { let userInfo:Dictionary<String,String> = notification.userInfo as! Dictionary<String,String> let item = userInfo["consent_string"]! as String DispatchQueue.main.async { self.lblConsentString.text = "Consent String \(item)" } // print(item,self) } /* function for initiating Adzapier CMP SDK which can be called on action listener of the view */ @IBAction func navigateToCMPSDK() { if let wd = UIApplication.shared.delegate?.window { var vc = wd!.rootViewController if(vc is UINavigationController){ vc = (vc as! UINavigationController).visibleViewController } if(vc is ViewController){ let bundle = Bundle(identifier: "adz.com.AdzapierCMPSDK") let launchScreenVC = UIStoryboard.init(name: Storyboard.kLaunchScreen, bundle: bundle) let rootVC = launchScreenVC.instantiateViewController(withIdentifier: ViewControllerVCID.kSplashScreen) self.present(rootVC, animated: true, completion: nil) let appDelegate = UIApplication.shared.delegate as! AppDelegate appDelegate.window = UIWindow(frame: UIScreen.main.bounds) let kOrganiserId = "084c2317-469d-4847-9932-8607e9e800d9" let kPropertyId = "97d57fba-e1a5-409b-a064-49cf534827db" CMPSDKManager.shared.setSplashScreen(appDelegate: appDelegate, orgId: kOrganiserId, propID: kPropertyId, vc: vc!) } } }}public var window: UIWindow?public var rootNavController: UINavigationController?