Promo mediation adaptor
This package provides a purchase adapter for Unity developers that use mediated ads with Unity IAP, who wish to use IAP Promos or Personalized Placements. The adaptor allows the Unity Ads SDK to receive purchase and conversion events while in mediation.
The Promo Mediation Adapter requires the following:
- Your game is built in Unity, using version 2017.1 or higher.
- Your game uses Unity Ads in a mediation stack (verified compatible with AdMob, MoPub, and ironSource; see section on Compatibility, below).
- Your game uses Unity IAP version 1.16 or higher. ## Using the adapter First, integrate Unity Ads as specified by your mediation partner. For more information on mediated integrations for Unity, click here, or reference the following quick links:
- MoPub integration
- AdMob integration
- ironSource integration
Next, initialize the SDK with the adapter’s new method signature:
public static void Initialize (IStoreListener listener, ConfigurationBuilder builder) To use this method, you must implement an
IStoreListenerinterface, and create a
ConfigurationBuilderobject. Both are requirements for Unity IAP, and covered in the Unity IAP initialization documentation. For example:
UnityAdsPurchasing.Initialize (myListener, myBuilder);
Note: When using the adapter, the
UnityAdsPurchasing.Initialize method replaces the Unity IAP
UnityPurchasing.Initialize method you would otherwise use.
The Promo Mediation Adapter is verified as compatible with AdMob, MoPub, and ironSource. However, as ironSource repackages Unity’s native binaries and renames the files, ironSource customers building to iOS must follow these additional steps:
- Open the UnityAdsPurchasingWrapper.mm file via your Project’s file folder, or the Unity Editor’s Project window (Plugins/UnityAdsMediationAdapter/UnityAdsPurchaseWrapper.mm).
- Delete the top two imports (
UnityAds/UADSMetaData.h), and replace them with the following:
#import <ISUnityAdsAdaptor/UASDPurchasing.h> #import <ISUnityAdsAdaptor/UADSMetaData.h> ## Known issues Do not import both the Asset Store package and the Package Manager package in your Project, as it will cause duplicate definition errors. Any use of this adapter in a custom manner is not supported, and could result in errors or bugs in your integration. If you experience problems or have questions, please contact Unity Ads support.