Enabling the Mobile Ads Unity plugin
This is an archived version of the documentation. Actual documentation for all platforms can be found here.
Mobile Ads Unity is a plugin for the Unity3d game platform that supports the Yandex Mobile Ads SDK.
- To load ads of any type, you need iOS 12.0 or later.
- To run the SDK, you need the Target API Level 31 or higher.
Integrating the plugin
yandex-ads-unity-plugin
runs only in Android and iOS environments. You can't use it in the Unity editor.- Lite version
-
Download the directory
yandex-ads-unity-plugin
and add the packageyandex-mobileads-lite-2.9.0.unitypackage
.How to add a packageSelect a plugin (Import.), then clickAdd the Google resolver: download the directory
unity-jar-resolver
and add the packageexternal-dependency-manager-latest.unitypackage
.How to add a packageSelect a plugin (Import.), then click- Use the Google resolver to install dependencies: enable auto-resolve or select in the menu.
- To test the Mobile Ads Unity plugin, use a sample script from the samples directory in the
yandex-ads-unity-plugin
repository. Copy the script to the project directory and add it as a Component to the main camera.
Downgrading the Target API Level
To downgrade the Target API Level to 30, add the explicit downgrade to mainTemplate.gradle and launcherTemplate.gradle (if you use launcherTemplate in the project):
configurations.all {
resolutionStrategy {
force 'androidx.core:core:1.6.0'
force 'androidx.core:core-ktx:1.6.0'
}
}
However, we recommend that you upgrade to the Target API Level 31, because Google has restrictions on releasing updates for applications running an outdated version of the Target API Level. Learn more in the article.