Setup Legal Frameworks
When you use a monetization SDK, it is essential to comply with applicable privacy regulations. With MAS SDK, you have two options to meet the legal requirements: you can either use your own privacy dialog or utilize the built-in privacy dialog provided by the MAS SDK.
Custom Privacy Dialog
When you use your own privacy dialog :
- If the user's age >= 13, then set COPPA to false, otherwise set it to true.
- If the user's age >= 16 and consents to having his data collected, then set GDPR to true, otherwise set it to false.
- If the user consents to having his data collected, then set CCPA to false, otherwise set it to true.
You'll find the details about how to set the legal frameworks through these links:
MAS SDK Privacy Dialog
You can enable the built-in privacy compliance dialog to collect the user's age and consent. Here is a picture of the pop up:
Enable SDK Privacy Dialog
To enable the SDK privacy dialog, you need to call the following method before initializing the SDK:
- Unity
- Java
- Kotlin
- Swift
- Objective-C
Yodo1AdBuildConfig config = new Yodo1AdBuildConfig().enableUserPrivacyDialog(true);
// Update the agreement link
config = config.userAgreementUrl("Your user agreement url");
// Update the privacy link
config = config.privacyPolicyUrl("Your privacy policy url");
Yodo1U3dMas.SetAdBuildConfig(config);
Yodo1MasAdBuildConfig.Builder configBuilder = new Yodo1MasAdBuildConfig.Builder().enableUserPrivacyDialog(true)
// Update the agreement link
configBuilder = configBuilder.userAgreementUrl("Your user agreement url")
// Update the privacy link
configBuilder = configBuilder.privacyPolicyUrl("Your privacy policy url")
Yodo1Mas.getInstance().setAdBuildConfig(configBuilder.build())
val configBuilder = Yodo1MasAdBuildConfig.Builder().enableUserPrivacyDialog(true)
// Update the agreement link
configBuilder = configBuilder.userAgreementUrl("Your user agreement url")
// Update the privacy link
configBuilder = configBuilder.privacyPolicyUrl("Your privacy policy url")
Yodo1Mas.getInstance().setAdBuildConfig(configBuilder.build())
var config = Yodo1MasAdBuildConfig.instance()
config.enableUserPrivacyDialog = true
// Update the agreement link
config.userAgreementUrl = "Your user agreement url"
// Update the privacy link
config.privacyPolicyUrl = "Your privacy policy url"
Yodo1Mas.sharedInstance().setAdBuildConfig(config)
Yodo1MasAdBuildConfig *config = [Yodo1MasAdBuildConfig instance];
config.enableUserPrivacyDialog = YES;
// Update the agreement link
config.userAgreementUrl = @"Your user agreement url";
// Update the privacy link
config.privacyPolicyUrl = @"Your privacy policy url";
[[Yodo1Mas sharedInstance] setAdBuildConfig:config];
Customize the appearance (optional)
The popup is divided into 3 sections:
- Title sections
- Content sections
- Button sections
You should customize the background color of the 3 highlighted areas.
- Unity
- Java
- Kotlin
- Swift
- Objective-C
Yodo1MasUserPrivacyConfig userPrivacyConfig = new Yodo1MasUserPrivacyConfig()
.titleBackgroundColor(Color.green)
.titleTextColor(Color.blue)
.contentBackgroundColor(Color.black)
.contentTextColor(Color.white)
.buttonBackgroundColor(Color.red)
.buttonTextColor(Color.green);
Yodo1AdBuildConfig config = new Yodo1AdBuildConfig()
.enableUserPrivacyDialog(true)
.userPrivacyConfig(userPrivacyConfig);
Yodo1U3dMas.SetAdBuildConfig(config);
Yodo1MasUserPrivacyConfig agePopBuildConfig = new Yodo1MasUserPrivacyConfig.Builder()
.titleBackgroundColor(Color.BLUE)
.titleTextColor(Color.WHITE)
.contentBackgroundColor(Color.WHITE)
.contentTextColor(Color.BLACK)
.buttonBackgroundColor(Color.BLUE)
.buttonTextColor(Color.WHITE)
.build();
Yodo1MasAdBuildConfig config = new Yodo1MasAdBuildConfig.Builder()
.enableUserPrivacyDialog(true)
.userPrivacyConfig(agePopBuildConfig)
.build();
Yodo1Mas.getInstance().setAdBuildConfig(config);
val agePopBuildConfig = Yodo1MasUserPrivacyConfig.Builder()
.titleBackgroundColor(Color.BLUE)
.titleTextColor(Color.WHITE)
.contentBackgroundColor(Color.WHITE)
.contentTextColor(Color.BLACK)
.buttonBackgroundColor(Color.BLUE)
.buttonTextColor(Color.WHITE)
.build()
val config = Yodo1MasAdBuildConfig.Builder()
.enableUserPrivacyDialog(true)
.userPrivacyConfig(agePopBuildConfig)
.build()
Yodo1Mas.getInstance().setAdBuildConfig(config)
let privacyConfig = Yodo1MasUserPrivacyConfig.instance()
privacyConfig.titleBackgroundColor = UIColor.blue
privacyConfig.titleTextColor = UIColor.white
privacyConfig.contentBackgroundColor = UIColor.white
privacyConfig.contentTextColor = UIColor.darkText
privacyConfig.buttonBackgroundColor = UIColor.blue
privacyConfig.buttonTextColor = UIColor.white
let config = Yodo1MasAdBuildConfig.instance()
config.enableUserPrivacyDialog = true
config.userPrivacyConfig = privacyConfig
Yodo1Mas.sharedInstance().setAdBuildConfig(config)
Yodo1MasUserPrivacyConfig *privacyConfig = [Yodo1MasUserPrivacyConfig instance];
privacyConfig.titleBackgroundColor = UIColor.blueColor;
privacyConfig.titleTextColor = UIColor.whiteColor;
privacyConfig.contentBackgroundColor = UIColor.whiteColor;
privacyConfig.contentTextColor = UIColor.darkTextColor;
privacyConfig.buttonBackgroundColor = UIColor.blueColor;
privacyConfig.buttonTextColor = [UIColor whiteColor];
Yodo1MasAdBuildConfig *config = [Yodo1MasAdBuildConfig instance];
config.enableUserPrivacyDialog = YES;
config.userPrivacyConfig = privacyConfig;
[[Yodo1Mas sharedInstance] setAdBuildConfig:config];
Get User Age and ATT Status (optional)
You can get the user's age and ATT status through the following methods if you need this data.
- Unity
- Java
- Kotlin
- Swift
- Objective-C
int age = Yodo1U3dMas.GetUserAge();
int attStatus = Yodo1U3dMas.GetAttrackingStatus();
switch(attStatus) {
case Yodo1U3dAttrackingStatus.NotDetermined: break;
case Yodo1U3dAttrackingStatus.Restricted: break;
case Yodo1U3dAttrackingStatus.Denied: break;
case Yodo1U3dAttrackingStatus.Authorized: break;
case Yodo1U3dAttrackingStatus.SystemLow: break; // iOS version below 14
}
int age = Yodo1Mas.getInstance().getUserAge();
val age = Yodo1Mas.getInstance().getUserAge()
let age = Yodo1Mas.sharedInstance().userAge
let attStatus = Yodo1Mas.sharedInstance().attrackingStatus
switch(attStatus) {
case .notDetermined: break;
case .restricted: break;
case .denied: break;
case .authorized: break;
case .systemLow: break; // iOS version below 14
}
NSInteger age = [Yodo1Mas sharedInstance].userAge;
Yodo1MasATTrackingStatus attStatus = [Yodo1Mas sharedInstance].attrackingStatus;
switch(attStatus) {
case Yodo1MasATTrackingStatusNotDetermined: break;
case Yodo1MasATTrackingStatusRestricted: break;
case Yodo1MasATTrackingStatusDenied: break;
case Yodo1MasATTrackingStatusAuthorized: break;
case Yodo1MasATTrackingStatusSystemLow: break; // iOS version below 14
}