💡 Tips
- 🔧 Unity version: 2018.2 or higher (For Admob, Unity 2022.3.x or higher is required)
- ⚠️ Please call all APIs of this SDK on the main thread
🟢 For Android, this plugin requires you to enable Jetifier. To enable Jetifier, follow these steps:
- In Unity, select Assets > External Dependency Manager > Android Resolver > Settings.
- In the Android Resolver Settings dialog that appears, check Use Jetifier
- Click OK
🔵 For Android, this plugin requires you to generate template gradle files. To generate the files, follow these steps:
- In Unity, select Project Settings > Player > Publishing Settings.
- Find "Custom Main Gradle Template", "Custom Gradle Setting Template", "Custom Gradle Properties Template", and check them
- Select Assets > External Dependency Manager > Android Resolver > Force Resolve
🟠 If you're integrating Admob, you must add Admob's APPLICATION_ID. Please follow these steps:
- In Unity, select Project Settings > Player > Publishing Settings.
- Find "Custom Launcher Manifest", and check it
- Add the configuration to the generated file as follows:
xml Copy<manifest xmlns:android="http://schemas.android.com/apk/res/android"> <application android:label="@string/app_name"> <!--Admob APPLICATION_ID start--> <meta-data android:name="com.google.android.gms.ads.APPLICATION_ID" android:value="<your admob application id>" /> <!--Admob APPLICATION_ID end--> </application> </manifest>
Please follow these steps to import the plugin:
(1). In Unity, select Assets > Import Package > Custom Package
(2). Select the Unity plugin file you downloaded
(3). In the Import Unity Package dialog, click Import
McSdkCallbacks.OnSdkInitializedEvent += sdkConfiguration =>
{
// McSDK is initialized, configure and start loading ads.
Debug.Log("McSDK Initialized: " + sdkConfiguration.ToString());
Debug.Log("McSDK Mediation Config: " + McSdk.GetMediationConfig());
};
McSdk.InitializeSdk("your app id", "your app key");
It is recommended to configure a preset strategy to improve ad loading performance during the first launch of your application