1. Integrate the SDK Into Your Project
1. Download Unity Plugin
- MAS supports Unity 2017.4.37f1+ LTS version, 2018.4.30f1+ LTS version, 2019.41f18+ LTS version, 2020 all version and above.
- Jetifier is required for Android builds and can be enabled by selecting Assets > External Dependency Manager > Android Resolver > Settings > Use Jetifier
- For MAS SDK 3.14.0 and above,
CocoaPodsis required for iOS builds and can be installed following the instructions here
Xcode12+is required for iOS14, please make sure your xcode is lastest version.
- The Unity plugin contains Sample code. The path is "Assets/Yodo1Ads/Sample"
1.2 Open your Unity project and import the Unity package.
1.3 Double click the compressed package icon. The files will populate automatically as illustrated below.
Important! The MAS Unity Plugin is built for Android & iOS platforms. Please run your projects on an Android or iOS device to test ads when the integration is completed.
2. Enter Application Information
MAS provides a configuration wizard for Unity to quickly configure application information. You can access it through "Assets/Yodo1 MAS Settings".
You will need to take the app key (generated in the game submission process) and add it into the configuration fields. You will also need to use the Admob ID generated by the MAS Dashboard.
Why use the Admob id generated by the MAS dashboard and not your Admob id?
The Admob id on the MAS dashboard is generated by Yodo1's Admob account. The MAS includes Admob, and MAS can only successfully monetize with Yodo1's Admob id generated for YOUR specific game in the MAS dashboard.
Where can you find the Admob id in the MAS dashboard?
First, visit https://mas.yodo1.com/app/list, making sure you are logged in.
Second, click on Details to get access to the page with your Admob ID for your given game. You will also find your app key for the game there.
Finally, copy the Admob App ID and the App key into the configuration window for both iOS and Android.
3. Support AndroidX
3.1 Look for and click on "Settings" under "Assets".
3.2 Select "Use Jetifier".
4. Comply With Necessary Legal Frameworks
Please comply with all legal frameworks that apply to your game and its users. You can find information on compliance through these links:
IMPORTANT! Failure to comply with these frameworks can lead the Apple App Store and/or Google Play Store rejecting your game, as well as a negative impact of your game's monetization.
5. Initialize the SDK
Please initialize the SDK at launch of the application. Use the code below, and please note the screenshot for implementation from our example project.
IMPORTANT! Notice the COPPACheck Boolean? We added it to make sure that COPPA compliance is checked BEFORE initializing the SDK. This is critical, please check out our full sample project here.
6. AdMob Android Manifest Merging Errors
The AdMob SDK use the
<queries> element in their bundled Android Manifest files. If you are on an incompatible version of the Android Gradle plugin, you will encounter the following build errors, respectively:
com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed error: unexpected element <queries> found in <manifest>.
You will need to upgrade to one of the following versions of the Android Gradle plugin that supports it:
|Current Android Gradle Plugin Version||Supported Android Gradle Plugin Version|
To update the Gradle Plugin version to a compatible one, please enable the custom base Gradle template by selecting Edit > Project Settings > Android tab > Publisher Settings > Custom Base Gradle Template.
The template will be located at
Assets/Plugins/Android/mainTemplate.gradle for Unity 2019.2 or below and
Assets/Plugins/Android/baseProjectTemplate.gradle for Unity 2019.3 or above. Then update the below line with the appropriate version:
If you are on Unity 2017.4 or below, please ensure that you are on at least 2017.4.40 which uses a compatible version of the Gradle Plugin by default.
Detailed steps for different versions of Unity can be found here.
7. How can you check if MAS is in your APK?
1) If MAS is present, your APK will have the following structure:
2.1) If you're using gradle then you will find reference 'com.yodo1:advert-gp:versioncode' in the file at the end of .gradle in the assets/plugins/Android folder ( in china the reference is 'com.yodo1:advert-cn:versioncode' ）
2.2）If you're using Android Resolver you will find the file com.yodo1:advert-gp-versioncode.aar in the assets/plugins/Android folder ( in china the file is com.yodo1:advert-cn-versioncode.aar ）
3) If MAS is present, your APK will have the package com.yodo1.advert in one of the .dex files as the following structure:
Drag apk file to AndroidStudio, or you can follow this guide Analyze your build with APK Analyzer
4) The MAS initialization log will be in the console: