Initialize

0. GDPR (General Data Protection Regulation)

The GDPR is the European Union's (hereinafter 'EU') data protection law, and service providers must obtain user consent regarding the collection and use of personal data of EU users or equivalent information. This is the procedure required for GDPR compliance and for ad network operations under the regulation.

1. Initialize & GDPR Content UI

On initialization, it provides the necessary features to obtain and process GDPR consent from users in the European Economic Area (EEA). In the AppDelegate, call the initialization function before making any ad-related requests.

  • Use the ADX App ID issued by ADX in place of "<ADX_APP_ID>".

  • SDK initialization should be called only once when the app launches and ad requests should be made after SDK initialization is complete.

    • Do not request ads until the ADXCompletionHandler closure (block) has been received.

  • Select one of the items below as the GdprType.

GDPR Type

Description

ADXGdprTypePopupLocation

Show the consent popup depending on the region (EU region).

ADXGdprTypePopupDebug

Show the consent popup regardless of region for testing purposes (DEBUG).

ADXGdprTypeDirectNotRequired

Regions where consent is not required (non-EU regions).

ADXGdprTypeDirectDenied

The user has refused the collection and use of personal data.

ADXGdprTypeDirectConfirm

The user has agreed to the collection and use of personal data.

Case 1. Display the GDPR consent screen for users in the EEA

Provides a consent screen that allows users in the European Economic Area (EEA) to choose whether to give consent.

  • In ADXConfiguration, set GdprType to ADXGdprTypePopupLocation. Depending on the user’s country, EU users can provide consent through the GDPR consent UI.

  • If you set GdprType to ADXGdprTypePopupDebug, the consent UI will show regardless of the user’s country.

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    ADXConfiguration *configuration = 
    [[ADXConfiguration alloc] initWithAppId:@"<ADX_APP_ID>"
        gdprType:ADXGdprTypePopupLocation
        testDevices:@[@""]];
                                                                     
    [[ADXSdk sharedInstance] initializeWithConfiguration:configuration
                                       completionHandler:^(BOOL result, ADXConsentState consentState) {
        NSLog(@"ADX Sdk Initialize");
    }];
    
    return YES;
}

To test the AdMob UMP GDPR consent screen, the following two steps are required:

1) Go to the AdMob dashboard (https://apps.admob.com) and follow the GDPR message creation guide to create and publish the message:

https://support.google.com/admob/answer/10113207?hl=en


2) When the iOS app is installed on a device, a message like the one below will be output to the Xcode console. Copy the identifier string from the console and use it in ADXConfiguration when creating the testDevices object. Set gdprType to ADXGdprTypePopupDebug (popupDebug) for testing.


To enable debug mode for this device, set:

UMPDebugSettings.testDeviceIdentifiers = @[ @"1C0484F0-1D76-4197-A63A-622C322D25CF" ];


<UMP GDPR Consent Screen>

Case 2. Direct Consent State

If your app does not have users in the European Economic Area (EEA) or does not collect personal data as defined by GDPR (e.g., account registration within the app), you must handle consent manually.

  • For regions outside the European Economic Area (EEA) where consent is not required, set GdprType to ADXGdprTypeDirectNotRequired in ADXConfiguration.

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // Note: When using AdMob UMP's IDFA message, use 'ADXGdprTypePopupLocation'
    ADXConfiguration *configuration = 
    [[ADXConfiguration alloc] initWithAppId:@"<ADX_APP_ID>"
        gdprType:ADXGdprTypeDirectNotRequired
        testDevices:@[@""]];
                                                                     
    [[ADXSdk sharedInstance] initializeWithConfiguration:configuration
                                       completionHandler:^(BOOL result, ADXConsentState consentState) {
        NSLog(@"ADX Sdk Initialize");
    }];
    
    return YES;
}

2. ConsentState

GDPR consent can have one of the following four states.

State

Description

ADXConsentStateUnknown

Users with no consent status: personalized ads will not be shown.

ADXConsentStateNotRequired

Regions where consent is not required (non-EU regions): personalized ads will be shown.

ADXConsentStateDenied

Users who have refused the collection and use of personal data: personalized ads will not be shown.

ADXConsentStateConfirm

Users who have agreed to the collection and use of personal data: personalized ads will be shown.

To check or update the consent state, use the following functions provided by ADXGdprManager.

// Checks the consent state of the user set in ADXGdprManager.
[ADXGdprManager sharedInstance].consentState;

// Manually updates the consent state.
[[ADXGdprManager sharedInstance] setConsentState:ADXConsentStateConfirm];

You can redisplay the GDPR consent screen to the user, allowing the consent state to be updated.

#import <ADXLibrary/ADXLibrary.h>

UIViewController * viewController = self;
[[ADXSdk sharedInstance] showGDPRForm:viewController 
    completionHandler:^(BOOL result) {
    
}];
  • Call the above method only in response to user input events, such as a button click. Calling it without a user input event may result in unexpected behavior.

  • If the user is not in the European Economic Area (EEA), the GDPR consent screen may not be redisplayed.

  • However, if consent information already exists, the GDPR consent screen may still be displayed even for users outside the EEA.

4. Privacy Policy

You can access the URL of ADX’s Privacy Policy by calling privacyPolicyURL in ADXGdprManager.

[ADXGdprManager sharedInstance].privacyPolicyURL;

5. Enable Debugging Logging

To verify proper integration and mediation during QA, set the logLevel in ADXConfiguration before calling the initialization method.

 ADXConfiguration *configuration = 
 [[ADXConfiguration alloc] initWithAppId:@"<ADX_APP_ID>"
     gdprType:ADXGdprTypePopupLocation];
    
 configuration.logLevel = ADXLogLevelDebug;

6. Child-Directed Settings

If your content is intended for children under COPPA regulations or targets users below the consent age in the European Economic Area (EEA), you must configure AdMob targeting settings before calling the initialization function. For more details, refer to AdMob Targeting: https://developers.google.com/admob/ios/targeting?hl=en

Last updated

Was this helpful?