Skip to main content

Import and Initialize Unity Package

Before you start

Meson supports Unity version 2018.4.18f1 and above.

The download and use of the SDK is subject to the Meson SDK Licensing Terms. If you do not agree to these terms, do not download, access, or use the SDK, or the underlying services.

Download the Meson Unity Package#

You can download the Meson Unity Package here.

Import Meson Unity Package to the project#

In Unity, Go to Assets , go to Import Package and select Custom Package . Navigate to the downloaded Meson Unity Package. Select the package. The package contents will show on Unity. Select All and Import.



Managing and Adding 3rd Party Ad Network dependency#

To edit 3rd Party Ad Network support, edit MesonDependencies.xml

To access MesonDependencies.xml, Go to Assets > Meson > Scripts > Editor > MesonDependencies.xml

//Mandatory Dependencies
<androidPackage spec="ai.meson.sdk:meson:1.0.0-beta11"/>
<androidPackage spec="ai.meson.sdk:meson-core:1.0.1-beta8"/>
<androidPackage spec="org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.10"/>
<androidPackage spec="org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9"/>
<androidPackage spec="org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.9"/>
//iOS Ad Networks
<iosPod name="InMobiSDK" version="10.0.1"/>
<iosPod name="MesonInMobiAdapter" version=""/>
<iosPod name="Google-Mobile-Ads-SDK" version="8.12.0"/>
<iosPod name="MesonGAMAdapter" version=""/>
<iosPod name="MesonAdmobAdapter" version=""/>
<iosPod name="MesonSDK" version="1.0.0-beta5"/>
<iosPod name="IronSourceSDK" version=""/>
<iosPod name="MesonIronSourceAdapter" version=""/>
<iosPod name="AppLovinSDK" version="10.3.6"/>
<iosPod name="MesonApplovinAdapter" version=""/>
<iosPod name="UnityAds" version="3.7.5"/>
<iosPod name="MesonUnityAdapter" version=""/>
<iosPod name="MintegralAdSDK" version="7.0.3"/>
<iosPod name="MesonMintegralAdapter" version=""/>
<iosPod name="VungleSDK-iOS" version="6.10.3"/>
<iosPod name="MesonVungleAdapter" version=""/>
<iosPod name="FBAudienceNetwork" version="6.9.0"/>
<iosPod name="MesonFANAdapter" version=""/>
// Android Ad Networks
<!-- InMobi -->
<androidPackage spec="com.inmobi.monetization:inmobi-ads:10.0.1"/>
<androidPackage spec="ai.meson.sdk.mediation:inmobi:"/>
<!-- Google AdMob -->
<androidPackage spec=""/>
<androidPackage spec="ai.meson.sdk.mediation:admob:"/>
<!-- Google Ad Manager -->
<androidPackage spec=""/>
<androidPackage spec="ai.meson.sdk.mediation:gam:"/>
<!-- Facebook Audience Network -->
<androidPackage spec=""/>
<androidPackage spec="ai.meson.sdk.mediation:facebook:"/>
<!-- Vungle -->
<androidPackage spec="com.vungle:publisher-sdk-android:6.10.2"/>
<androidPackage spec="ai.meson.sdk.mediation:vungle:"/>
<!-- Mintegral -->
<androidPackage spec="com.mbridge.msdk.oversea:mbbid:15.7.41"/>
<androidPackage spec="ai.meson.sdk.mediation:mintegral:"/>
<androidPackage spec="com.mbridge.msdk.oversea:reward:15.7.41"/>
<androidPackage spec="com.mbridge.msdk.oversea:interstitialvideo:15.7.41"/>
<androidPackage spec="com.mbridge.msdk.oversea:mbbanner:15.7.41"/>
<androidPackage spec="com.mbridge.msdk.oversea:interstitial:15.7.41"/>
<!-- Unity -->
<androidPackage spec=""/>
<androidPackage spec="ai.meson.sdk.mediation:unity:"/>
<!-- App Lovin -->
<androidPackage spec="com.applovin:applovin-sdk:10.3.1"/>
<androidPackage spec="ai.meson.sdk.mediation:applovin:"/>

Initialise the Unity plugin using Meson Manager (Recommended)#

  1. Drag and drop the MesonManager prefab from Assets/Meson/Prefabs onto your scene.


  1. Enter the required settings as per your need.
Auto Initialise on StartCheck this option to automatically initialise the Meson SDK in Start (). The SDK must be initialised before you can request ads. Leaving it unchecked means you must manually initialise the SDK.
iOS App IDUnique Identifier for a iOS app generated on Meson UI while creating a new app
Android App IDUnique Identifier for a Android app generated on Meson UI while creating a new app
Log levelSpecify log verbosity (‘none’, ‘error’ or ‘debug’) for the Meson SDK.
GDPR ConsentGDPR consent can be passed either as a IAB v1 or v2 string, boolean value.
CallbackSubscribe to initialisation callback to listen to for initialisation event completion lifecycle.
  1. iOS and Android App ID must be set for successful integration.

Initialise the plugin manually#

  1. In the app Start() method, instantiate a Meson.SdkConfiguration object with i. iOS App ID - Unique Identifier for a iOS app generated on Meson UI while creating a new app ii. Android App ID - Unique Identifier for a Android app generated on Meson UI while creating a new app iii. Log level - Specify log verbosity (‘none’, ‘error’ or ‘debug’) for the Meson SDK. iv. Consent (optional) - GDPR consent can be passed either as a IAB v1 or v2 string, boolean value.
  2. Call Meson.InitializeSDK() and pass the Meson.SdkConfiguration Object
Dictionary<string, string> consentDictionary = new Dictionary<string, string>();
consentDictionary.Add(Meson.MESON_GDPR_CONSENT_AVAILABLE, "true");
consentDictionary.Add(Meson.MESON_GDPR_CONSENT_GDPR_APPLIES, "0");
consentDictionary.Add(Meson.MESON_GDPR_CONSENT_IAB, "IAB String v1 or v2");
Meson.InitializeSdk(new Meson.SdkConfiguration
AndroidAppId = "12345",
IOSAppId = "1234",
LogLevel = Meson.LogLevel.Debug,
ConsentDict = consentDictionary
  1. Register for onSDKInitializedEvent callback event.
// register for initialized callback event in the app
MesonManager.SdkInitializedEvent += OnSdkInitializedEvent;
// create your handler
private void OnSdkInitializedEvent(string adUnitId)
// The SDK is initialized here. Ready to make ad requests.

Add User Data#

  • To use cohorts in Meson UI, this is where you will need to set PPID unique to a user
  • To use segments or experiments in Meson UI, this is where you will need to send the segments or experiments.

This is optional. In case you want to send us any information about the user, please do as follows:

Dictionary<string, dynamic> extrasDictionary = new Dictionary<string, dynamic>();
extrasDictionary.Add("gender", 1);
extrasDictionary.Add("age", 18);
string[] segments = { "s1", "s2", "s3" };
extrasDictionary.Add("segments", segments);