IMPORTANT!
BEFORE proceeding to integration.
If you are an existing MAS Customer upgrading to 4.0, please read the upgrade document.
If you are integrating MAS into your game for the first time, please read the following article.
Step 1: Configure Your Environment
Before starting to work with MAS, we strongly recommend properly configuring your environment to make the build step of the SDK process more straightforward. This will avoid any issues later during the build process.
For Unity:
MAS supports Unity 2017.4.38f1+ LTS version, 2018.4.4f1+ LTS version, 2019.1.7f1+ LTS version, 2020 all version and above. Please make sure your version of Unity is compatible.
Unity 2018 starting from 2018.4.4f1 Unity 2019 starting from 2019.1.7f1
For Firebase:
If you are using Firebase, please upgrade to Firebase 7.0.0 or above. Lower versions will not be compatible with AdMob, as MAS uses the most updated version of the Admob SDK, which requires a matching version of Firebase.
If you can not use Firebase 7.0 or above, please take the following steps after adding the MAS SDK to your game,
-
Open the
mainTemplate.gradle
file in the directoryAssets/Plugins/Android
-
Change specified content, {MAS_SDK_VERSION} is the SDK version of MAS, e.g. 4.0.0.3
Beforeimplementation 'com.yodo1.mas:google:{MAS_SDK_VERSION}'
After
implementation('com.yodo1.mas:google:{MAS_SDK_VERSION}') { exclude group: 'com.google.android.gms' }
For iOS:
/bin/bash -c "$(curl -fsSL https://gist.githubusercontent.com/nicky9112/0bf903795f77c5052ff12c92e629f975/raw/a8783d03c96b8d1d50f92977bfa0112711fbc57a/install-cocoapods.sh)"
This will configure your environment to include the correct version of Cocoapods, a dependency manager for iOS responsible for downloading and managing all 3rd party ad networks included in MAS during the build phase. If you would like more information about Cocoapods, check this link.
In addition, make sure you are using Xcode12+
. And when building with Xcode, please make sure to open the Xcode workspace file instead of the Xcode project file when building your project:
open App.xcworkspace
Step 2: Download the Correct Unity Plugin For Your Game
MAS provides two versions of the Unity plugin, depending on your business scenario. If your game is participating in the "Designed for Families" program Google Play runs, you will need to use the "Designed For Families" plugin in order to be compliant with program requirements.
If you are unaware of this program, or unsure whether or not your game falls within it, please review this article from Google Play.
If your game is not part of the "Designed for Families Program", please use the Standard MAS Plugin. This includes if you are participating in the China App Store Accelerator Program.
Designed For Families Plugin Standard MAS Plugin
3. Integrate the SDK Into Your Project
Open your Unity project and import the Unity package. 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.
4. Enter Application Information
MAS provides a configuration wizard for Unity to quickly configure application information. You can access it through
Assets/Yodo1/MAS Settings
.
3.1 Set Android Configuration
Important! An invalid AdMob AppID will cause a crash. Please make sure to fetch the AdMob App ID from MAS dashboard
3.2 Set iOS Configuration
Important! An invalid AdMob AppID will cause a crash. Please make sure to fetch the AdMob App ID from MAS dashboard
5. Support AndroidX
Important! An invalid AdMob AppID will cause a crash. Please make sure to fetch the AdMob App ID from MAS dashboard.
4.1 Look for and click on "Settings" under "Assets".
4.2 Select Use Jetifier
.
COPPA As Needed (GLOBAL ONLY)
6. Comply WithIMPORTANT! Failure to comply with COPPA 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.
7. Initialize the SDK
7.1 Include the following line at the top of the file where you will initialize the MAS SDK:
using Yodo1.MAS;
7.2 Initialize the SDK in the Start
method of the file:
void Start() {
Yodo1U3dMas.InitializeSdk();
}
8. FBCoreKit Conflicts
If you are using a Facebook related SDK and have FBCoreKit conflict, you can resolve the conflict by following these steps
- Enter
Assets/Yodo1/MAS/Editor/Dependencies
directory and open theYodo1MasiOSDependencies.xml
file - Remove or comment
<iosPod name="FBSDKCoreKit" version="~> 6.5.2" bitcode="false" minTargetSdk="9.0" />
9. How can you check if MAS is in your apk?
1. If MAS is present, your Unity project will have the following structure:
2. Check Unity integration mode
2.1)If you're using gradle then you will find reference 'com.yodo1.mas:standard:versioncode'
or 'com.yodo1.mas:google:versioncode'
in the file at the end of .gradle in the Assets/Plugins/Android
folder.
2.2)If you're using Android Resolver you will find the file com.yodo1.mas:standard:version.aar
or com.yodo1.mas:google:version.aar
in the Assets/Plugins/Android
folder.
3. If MAS is present, your APK will have the package com.yodo1.advert in one of the .dex files, appearing with 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:
Known Issues
Due to the ever changing nature of our ad monetization partners' SDKs, MAS clients like you occasionally encounter issues that are not common to all developers, but come up often enough to be note.
The UIWebView Issue
Occasionally, a game will get rejected by Apple due to the presence of UIWebView. If this happens, click here to access a tool that will help you identify the source of the deprecated code. A common culprit is the changelog.txt file, which appears to report files from MAS. The issue is in reality attributable only to the changelog.txt file.
11. Dealing with Xcode Properly
Make sure to always open the Xcode workspace file instead of the Xcode project file when building your project:
open App.xcworkspace
Comments
0 comments
Please sign in to leave a comment.