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:

				
					<manifest>
	<application>
	<!-- Sample AdMob App ID: ca-app-pub-3940256099942544~3347511713 -->
	<meta-data
		android:name="com.google.android.gms.ads.APPLICATION_ID"
		android:value="YOUR_ADMOB_APP_ID"/>
	</application>
</manifest>
				
			

4. Comply With Legal Frameworks

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.
CONTENTS