Madex
  • Android SDK
    • Installing and configuring the SDK
    • Working with advertising
    • User Consent Screen
    • Adapters for other SDKs
      • Applovin MAX SDK
      • IronSource SDK
    • Change Log
  • iOS SDK
    • Installing and configuring the SDK
    • Working with advertising
    • User Consent Screen
    • Adapters for other SDKs
      • Applovin MAX SDK
      • IronSource SDK
    • Change Log
  • Unity Plugin
    • Installing and configuring the plugin
    • Working with advertising
    • User Consent Screen
    • Adapters for other SDKs
      • Applovin MAX SDK
      • IronSource SDK
    • Change log
  • Cordova Plugin
    • Installation and configuration the plugin
    • Working with advertising
    • Change Log
  • Construct3 Addon
    • Addon installation and configuration
    • Installation and configuration of Madex mediation addon
    • Working with advertising
Powered by GitBook
On this page
  • General Information
  • Consent screen and Consent Manager
  • Demo Application
  • Installation
  • Configure Podfile
  • Setting up Consent Manager
  • Working with Consent Manager
  • Initialization
  • Displaying the Permissions Request Screen
  • Checking the User's Consent Status
  • Updating the User's Consent Status (SDK method for advertising)
  • Debug Mode
  • Event Tracking
  1. iOS SDK

User Consent Screen

Library for demonstrating a ready-made consent screen for the collection, processing, and usage of user data.

Release Version 1.0.3 | Release Date 4/10/2023

Minimum requirements:

  • iOS 13.0 and above.

  • Use Xcode 13 and above.

The information provided below is not legal advice. Madex is not responsible for the consequences of its use. Before making legally significant decisions, it is recommended to consult with a lawyer.

General Information

To comply with the requirements of app stores and laws regulating the collection, processing, and usage of user personal data, obtaining the user's consent for the mentioned actions is required. If refused, no user data should be collected.

In addition to user consent, you will need to properly prepare a privacy policy and other documents required by app stores and the laws of the countries where your app is published.

Clear consent for the collection, processing, and usage of user data is required by most countries. Here are a few key documents describing this process:

  • GDPR (General Data Protection Regulation, Regulation (European Union) 2016/679)

  • COPPA (Children's Online Privacy Protection Rule)

  • CCPA (California Consumer Privacy Act)

Please note that this list is not exhaustive. It is recommended to study the legislation regulating user personal data in the countries where your app is published and consult with a lawyer before making legally significant decisions.

Consent screen and Consent Manager

Usually, user consent is obtained on a special screen during the first launch of the app — the consent screen.

Madex SDK implements such a screen, and you can add and customize it using the Consent Manager library. You can use it to avoid creating the Consent Screen yourself.

Demo Application

Use our demo application as an example.

Installation

Configure Podfile

  1. Add the dependency for installing Consent Manager to the Podfile file.

platform :ios, '13.0'

target 'Sample' do
    use_frameworks!

    # connection of Consent Manager SDK dependency
    pod 'MadexConsentManager', "1.0.3"
end
  1. Save the file and run pod install in the terminal in the project folder.

  2. Run the command pod install in the terminal to install the dependencies.

Use the pod update command to update dependencies

Setting up Consent Manager

Before using the user consent screen, it needs to be configured.

To set parameters, call the methods of the builder variable. Below is a list of all available settings:

  • appendPolicyURL - sets the link to your app's privacy policy. Consider this parameter as mandatory. Links to Madex's and our partners' privacy policies are already added to the consent screen.

  • appendBundle - sets a custom Bundle used to set the app's icon in the TopBar of the user consent screen. If the parameter is not filled, the existing app icon will be displayed.

  • appendName - sets the name of your app in the TopBar of the user consent screen. If the parameter is not filled, the existing app name will be displayed.

  • appendGDPR - adds a button for refusing data collection. Consent screen with one button: the option to refuse data collection is available to the user only through device settings.

    Consent screen with two buttons: the option to refuse data collection is available to the user by tapping the "No thanks" button.

Take a look at the complete example of setting parameters:

ConsentManager.registerCustomVendor { builder in
    let _ = builder
        .appendPolicyURL("https://madex.me/privacy-policies")
        .appendBundle("me.madex.ads.app")
        .appendName("Example name")
}

Working with Consent Manager

Initialization

We recommend calling SDK initialization in your ViewController - in the viewDidLoad method

override func viewDidLoad() {
    ConsentManager.loadManager()
}

Displaying the Permissions Request Screen

To display the screen, call the showConsentWindow method.

ConsentManager.showConsentWindow(self)

Checking the User's Consent Status

If the user has given consent to data collection, the method will return true.

ConsentManager.hasConsent

If the method returns false, it is strongly recommended not to collect any data about this user.

Updating the User's Consent Status (SDK method for advertising)

To update the consent status in the Madex SDK (for advertising purposes), use the setUserConsent method.

Madex.setUserConsent(ConsentManager.hasConsent)

Debug Mode

If you need error and event logging, enable debug mode. By default, it is turned off.

To enable debug mode, use the enableDebug method.

ConsentManager.enableLog(true)

Event Tracking

Consent Manager allows you to track events related to user consent for data collection.

To track events, do the following:

  1. Create an extension for ViewController and inherit it from the interface for event tracking.

extension YourViewController: ConsentDelegate {
    
    func onConsentManagerLoaded() {
       // Called when the manager is ready to show
    }
    
    func onConsentManagerLoadFailed(_ error: String) {
        // Called if an error occurred during loading
    }
    
    func onConsentWindowShown() {
        // Called when the screen is displayed
    }
    
    func onConsentManagerShownFailed(_ error: String) {
        // Called if there is an error during screen display
    }
    
    func onConsentWindowClosed(_ hasConsent: Bool) {
       // Called when the screen is closed
       // hasConsent - determines whether the user has given consent
    }
    
}
  1. Associate your event tracking ViewController with the Consent Manager SDK. Usually, the ViewController that works with Consent Manager is also the class for event tracking, so you can specify self as the delegate property.

ConsentManager.setDelegate(self)
PreviousWorking with advertisingNextAdapters for other SDKs

Last updated 5 months ago

Install Madex SDK. Detailed installation process is described in the .

Other Madex SDK methods (for working with ads) can be found in the .

corresponding section
corresponding section
GitHub - MadexTech/madex-ios-demoGitHub
Logo