Setting up a Plugin
- Your base plugin should implement the IAdSystemPlugin and register with the AdSystemAdapter. The AdSystemAdapter use this interface to notify you when the client wants to show an interstitial or a reward video.
public class AdSystemPluginMoPub : IAdSystemPlugin
{
#region IAdSystemPlugin
public void showInterstitial(string placement)
{
Instance.ShowAnAd(placement);
}
public void showRewardedVideo(string placement)
{
Instance.ShowARewardedVideoAd(placement);
}
#endregion
}
- Once your plugin is initialized you need to set it in the AdSystemAdapter
AdSystemAdapter.plugin = [Your IAdSystemPlugin Instance];
- All your plugins ad callbacks should get passed back through the IAdSystemListener and they will get propagated to the client.
AdSystemAdapter.Instance.onAdReady(placement);
Analytics
The AdSystemAdapter is setup to route analytics through to the Magic analytics system. For events to get fully processed they should conform to the standard Magic analytics standard. The data string passed in must be json formated.
AdSystemAdapter.onAnalyticEvent(string jsonEventData)