mediation | GDPR Consent for Third-party SDKs - iOS

With iOS SDK 904, we have introduced a new API for publishers to pass GDPR consent to various third parties that are part of Aerserv mediation.

+ (void)setAdapterGdprConsent:(NSDictionary *)adapterConsentDictionary;

The consent includes the following partners:

  • ADCOLONY
  • ADMOB
  • APPLOVIN
  • CHARTBOOST
  • FLURRY
  • MILLENNIALMEDIA
  • MOPUB
  • MYTARGET
  • UNITY
  • VUNGLE

Passing the GDPR Consent API

Use the following steps to pass GDPR consent API:

STEP 1: Create a new NSMutableDictionary instance as shown below:

		NSMutableDictionary *consentDict = [NSMutableDictionary new];
	

STEP 2: Add individual consent status for each partner SDK. Refer to the list below for partner-specific list of constants exposed in ASConstants.h. These should be used for passing consent for all listed SDKs.

  1. ADCOLONY:

    Key Type Inference
    AS_KEY_ADCOLONY_GDPR_CONSENT_STRING String Your user's consent string. In this case, the user has given consent to store and process personal information.

    Refer here for more info:

    AS_KEY_ADCOLONY_GDPR_REQUIRED Number Indicates the GDPR requirement of the user. If it is true, then the user is subject to the GDPR laws.

    Sample code:

    [consentDict addEntriesFromDictionary:@{
    	AS_KEY_ADCOLONY : @{
            AS_KEY_ADCOLONY_GDPR_CONSENT_STRING : @"1",
            AS_KEY_ADCOLONY_GDPR_REQUIRED: @1
        }
    }];
    
  2. ADMOB:

    Key Type Inference
    AS_KEY_ADMOB_NON_PERSONALIZED_ADS String The default behaviour of the Google Mobile Ads SDK is to serve personalized ads. If a user has consented to receive only non-personalized ads, you can use the below code to request non personalised regardless of whether or not the user is in the EEA.

    Refer here for more info:

    Sample code:

        [consentDict addEntriesFromDictionary:@{
    	AS_KEY_ADMOB : @{
            AS_KEY_ADMOB_NON_PERSONALIZED_ADS : @"1",
        }
    }];
    
  3. APPLOVIN:

    Key Type Inference
    AS_KEY_APPLOVIN_HAS_USER_CONSENT Number If the user has consented, please set the following key to 1 else 0.

    Refer here for more info:

    AS_KEY_APPLOVIN_IS_AGE_RESTRICITED_USE Number To ensure COPPA, GDPR, and Google Play policy compliance, you should indicate when a user is a child. If the user is known to be in an age-restricted category (i.e., under the age of 16), please set the following key to 1 else 0.

    Sample code:

        [consentDict addEntriesFromDictionary:@{
    	AS_KEY_APPLOVIN : @{
            AS_KEY_APPLOVIN_HAS_USER_CONSENT : @1,
            AS_KEY_APPLOVIN_IS_AGE_RESTRICITED_USER : @0,
        }
    }];
    
  4. CHARTBOOST:

    Key Type Inference
    AS_KEY_CHARTBOOST_PI_DATA_USE_CONSENT Number Set the consent status corresponding to the user's response using the given key.

    Use the number value to represent value of CBPIDataUseConsent enum.

    typedef NS_ENUM(NSInteger, CBPIDataUseConsent)
    {
     /*! Publisher hasn't implemented functionality or the user has the option to not answer. */
     Unknown = -1,
     /*! User does not consent to targeting (Contextual ads). */
     NoBehavioral = 0,
     /*! User consents (Behavioral and Contextual Ads). */
     YesBehavioral = 1
    };
    			

    Refer here for more info:

    Sample code:

        [consentDict addEntriesFromDictionary:@{
        AS_KEY_CHARTBOOST : @{
            AS_KEY_CHARTBOOST_PI_DATA_USE_CONSENT : @1
        }
    }];
    
  5. FLURRY:

    Key Type Inference
    AS_KEY_FLURRY_GDPR_SCOPE Number @1 states that GDPR laws apply, while @0 states that GDPR laws do not apply
    AS_KEY_FLURRY_CONSENT_STRINGS Dictionary Use this dictionary to give the value of Consent Strings.
    NSDictionary*  => .
    NSDictionary *consentDict = [[NSDictionary alloc] initWithObjectsAndKeys:@"iab", @"IAB_Consent_String", nil];
    			

    Refer here for more info:

    Sample code:

        [consentDict addEntriesFromDictionary:@{
        AS_KEY_FLURRY : @{
    	    AS_KEY_FLURRY_GDPR_SCOPE : @1,
    	    AS_KEY_FLURRY_CONSENT_STRINGS: @{@"key":@"value"}
        }
    }];
    
  6. MILENNIALMEDIA:

    Key Type Inference
    AS_KEY_MILLENNIALMEDIA_CONSENT_REQUIRED Number Set to @1 if the user falls under GDPR jurisdiction.
    AS_KEY_MILLENNIALMEDIA_CONSENTDATA_IAB String Sets the IAB Consent String.

    Refer here for more info:

    Sample code:

        [consentDict addEntriesFromDictionary:@{
        AS_KEY_MILLENNIALMEDIA : @{
            AS_KEY_MILLENNIALMEDIA_CONSENT_REQUIRED : @1,
            AS_KEY_MILLENNIALMEDIA_CONSENTDATA_IAB: @"iab_string"
        }
    }];
    
  7. MOPUB:

    Key Type Inference
    AS_KEY_MOPUB_CONSENT Number Set to @1 if the user wants to grant consent or @0 if user wants to revoke consent.

    Refer here for more info:

    Sample code:

        [consentDict addEntriesFromDictionary:@{
        AS_KEY_MOPUB : @{
            AS_KEY_MOPUB_CONSENT : @1,
        }
    }];
    
  8. MYTARGET:

    Key Type Inference
    AS_KEY_MYTARGET_USER_CONSENT Number Set the value to @1 if user has consented to collect data, or @0 to not collect data.

    Refer here for more info:

    AS_KEY_MYTARGET_USER_AGERESTRICTED Number If the user is known to be in an age-restricted category (i.e., under the age of 16), please set this key to @1.

    Sample code:

        [consentDict addEntriesFromDictionary:@{
        AS_KEY_MYTARGET : @{
            AS_KEY_MYTARGET_USER_CONSENT : @1,
            AS_KEY_MYTARGET_USER_AGERESTRICTED: @0
        }
    }];
    
  9. UNITY:

    Key Type Inference
    AS_KEY_UNITY_GDPR_CONSENT Number If the user opts-in to targeted advertising set the value to @1 else @0.

    Refer here for more info:

    Sample code:

        [consentDict addEntriesFromDictionary:@{
        AS_KEY_UNITY : @{
            AS_KEY_UNITY_GDPR_CONSENT : @1,
        }
    }];
    
  10. VUNGLE:

    Key Type Inference
    AS_KEY_VUNGLE_CONSENT_STATUS Number Use this key to set corresponding integer value for VungleConsentStatus enum.
    typedef NS_ENUM (NSInteger, VungleConsentStatus) {
        VungleConsentAccepted = 1,
        VungleConsentDenied,
    };
    			

    Refer here for more info:

    AS_KEY_VUNGLE_CONSENT_MESSAGE_VERSION String It sets the consent message version. This value is an arbitrary string and can be used to identify the version of the consent message presented to the user.

    Sample code:

       [consentDict addEntriesFromDictionary:@{
        AS_KEY_VUNGLE : @{
            AS_KEY_VUNGLE_CONSENT_STATUS : @1,
            AS_KEY_VUNGLE_CONSENT_MESSAGE_VERSION : @"version",
        }
    }];
    

STEP 3: Pass the final consent dictionary created using the following API:

		[AerServSDK setAdapterGdprConsent:consentDict];