SDK Integration
1. Add the MultiDex
Property to the defaultConfig
Section
defaultConfig {
...
multiDexEnabled true
...
}
2. Support AndroidX
Add this content to the gradle.properties
file:
android.useAndroidX=true
android.enableJetifier=true
android.enableDexingArtifactTransform=false
3. Add AdMob App ID
- Add your
AdMob App ID
to your app’s AndroidManifest.xml file by including the<meta-data>
tag. - Your AdMob App ID can be found under the “details” of your app on MAS Dashboard.
- Please replace
android:value
with your own AdMob App ID:
4. Comply With Legal Frameworks
Important
- It’s mandatory to use a privacy dialog to comply with Play Store and App Store policies and also avoid any revenue loss.
- If you use MAS built-in privacy dialog, the legal frameworks will be configured automatically.
- If you prefer using your own privacy dialog, you should check the users’ age and add an agreement link to get their consent to having their data collected, then set all the legal frameworks manually.
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 privacy dialog
You can enable the built-in privacy compliance dialog to collect the users’ age and consent. Here is a picture of the pop up:

1. Enable (Before the SDK initialization)
Yodo1MasAdBuildConfig config = new Yodo1MasAdBuildConfig.Builder().enableUserPrivacyDialog(true).build(); Yodo1Mas.getInstance().setAdBuildConfig(config);
val config = Yodo1MasAdBuildConfig.Builder(). enableUserPrivacyDialog(true).build() Yodo1Mas.getInstance().setAdBuildConfig(config)
2. Custom user agreement (optional)
Yodo1MasAdBuildConfig config = new Yodo1MasAdBuildConfig.Builder().enableUserPrivacyDialog(true).userAgreementUrl("Your user agreement url").build(); Yodo1Mas.getInstance().setAdBuildConfig(config);
val config = Yodo1MasAdBuildConfig.Builder().enableUserPrivacyDialog(true).userAgreementUrl("Your user agreement url").build() Yodo1Mas.getInstance().setAdBuildConfig(config)
3. Custom privacy policy (optional)
Yodo1MasAdBuildConfig config = new Yodo1MasAdBuildConfig.Builder().enableUserPrivacyDialog(true).privacyPolicyUrl("Your privacy policy url").build(); Yodo1Mas.getInstance().setAdBuildConfig(config);
val config = Yodo1MasAdBuildConfig.Builder().enableUserPrivacyDialog(true).privacyPolicyUrl("Your privacy policy url").build() Yodo1Mas.getInstance().setAdBuildConfig(config)
4. Customize the appearance of the pop up (optional)
The pop up is divided into 3 sections:

- You can customize the background color of the 3 highlighted areas.
- You can customize the top text, button text, and black font text in the content area.
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)
5. Get user age (optional)
int age = Yodo1Mas.getInstance().getUserAge();
val age = Yodo1Mas.getInstance().getUserAge()
5. Initialize the SDK
Initialize the SDK by using the onCreate
method of Activity
.
protected void onCreate() { super.onCreate(); Yodo1Mas.getInstance().init(this, "Your Appkey",new Yodo1Mas.InitListener() { @Override public void onMasInitSuccessful() { } @Override public void onMasInitFailed(@NonNull Yodo1MasError error) { } }); }
Yodo1Mas.getInstance().init(this, "YourAppKey", object : Yodo1Mas.InitListener { override fun onMasInitSuccessful() { Toast.makeText(this@MainActivity, "[Yodo1 Mas] Successful initialization", Toast.LENGTH_SHORT).show() } override fun onMasInitFailed(error: Yodo1MasError) { Toast.makeText(this@MainActivity, error.message, Toast.LENGTH_SHORT).show() } })
- Note: Please use your Appkey for initialization, not the Admob App ID. Your Appkey can be found under the “details” of your app on MAS Dashboard.