FreeStar Ads Mediation for Unity Android - freestar-archive/freestarcapital-SDK_documentation_Android GitHub Wiki
Freestar Ads Mediation - Unity Integration Guide for Android
Start displaying Freestar Ads in your Unity game today by following the simple steps below.• Unity 2018 or newer
• Minimum Android API Level: 21 or higher
Please follow the instructions in order.
Make sure you switched to Android:
Other settings: Minimum API Level: 21
Other settings: Target API Level: Highest Installed
Other settings: Api Compatability Level: .NET 4.x
Publisher Settings: Custom Gradle Template ✅
If you try to use Unity Ads Package with FreestarMediation, this will produce a build-time error because FreestarMediation already contains the Unity Ads library.
Download FreestarMediation.unitypackage
Next, we will import it into Unity as a Custom Package.
Assets: Import Package: Custom Package
Hit the Import button.
After importing our custom package, resolve Android dependencies via Assets.. External Dependency Manager... Android Resolver... Resolve.
Use your favorite file editor.
Edit [Unity Project Folder]/Assets/Plugins/Android/mainTemplate.gradle
// GENERATED BY UNITY. REMOVE THIS COMMENT TO PREVENT OVERWRITING WHEN EXPORTING AGAIN
Add the following to the android root section:
packagingOptions {
exclude("META-INF/*.kotlin_module")
}
Save your changes to mainTemplate.gradle
Take a look at file [Unity Project Folder]/Assets/Plugins/Android/AndroidManifest.xml
Before going to production, you will need to modify the following values. For now, you can use what's already there.
<meta-data android:name="com.google.android.gms.ads.APPLICATION_ID" android:value="ca-app-pub-3940256099942544~3347511713"/> <meta-data android:name="applovin.sdk.key" android:value="hO52kFtMvEo_AoeRzED0_XXfS1B1VQp9GW50yudJO-eUUTOmRBLl3c-2GyTevLNspll_fN5PLTbAHOakoTuHuP" /> <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version"/>
At this point, you should be able to build Android. If you encounter the following dialogs, hit 'YES'.
OR
Take a look at Assets/FreestarMediation/SampleFreestarAds.cs which was imported into your Unity project.
This working sample shows how to initialize, implement the ad listeners, and show banner, fullscreen Interstitial and Rewarded ads.
Assets/FreestarMediation/SampleFreestar.scene is also included.
Some publishers like to create a singleton class based on this sample. Utilize it as you see fit.
You can use the test key in SampleFreestarAds.cs