This guide is intended for publishers who want to monetize their Android apps/games built using Unity with AdPushup AdX ads. Integrating the Ap Unity Kit into an app is the first step toward implementing AdPushUp AdX Ads in your app.
Use the links below to download the Unity package for the plugin or to take a look at its code on GitHub.
💡 It is advisable to add the **Google Mobile Ads Unity plugin** before adding Ap Unity Kit. Ap Unity Kit uses the **[Unity Play Services Resolver library](https://github.com/googlesamples/unity-jar-resolver)** which is distributed with the Google Mobile Ads Unity plugin.-
Open your project in the Unity editor. Select Assets > Import Package > Custom Package and find the
ApUnityKit.unitypackage
file you downloaded. -
Make sure all of the files are selected and click Import.
-
In the Unity editor, select Assets > External Dependency Manager > Android Resolver > Resolve. The Unity External Dependency Manager library will copy the declared dependencies into the
Assets/Plugins/Android
directory of your Unity app.
You just need to call ApUnityKit.PingAdClosed()
, ApUnityKit.PingAdOpened()
, ApUnityKit.PingAdLoaded()
, and ApUnityKit.PingAdImpression()
with the ad event callbacks.
// Your Google Ads Events Callback Functions
private void HandleOnAdClosed(object sender, EventArgs e)
{
ApUnityKit.PingAdClosed(adUnitId, rewardedAd.GetResponseInfo().GetResponseId());
}
private void HandleOnAdOpened(object sender, EventArgs e)
{
ApUnityKit.PingAdOpened(adUnitId, rewardedAd.GetResponseInfo().GetResponseId());
}
private void HandleOnAdLoaded(object sender, EventArgs e)
{
ApUnityKit.PingAdLoaded(adUnitId, rewardedAd.GetResponseInfo().GetResponseId());
}
private void HandleAdImpression(object sender, EventArgs e)
{
ApUnityKit.PingAdImpression(adUnitId, nativeAd.GetResponseInfo().GetResponseId());
}
// ...