Skip to main content

Interstitial

info

Here you can find our demo implementation of interstitial ads in Bidon.

Create An Instance

Add Bidon namespace to your script.

using Bidon.Mediation;

Create a BidonInterstitialAd instance.

var bidonInter = new BidonInterstitialAd();

Subscribe To Events

Subscribe to desired events for receiving callbacks during ad object lifecycle.

bidonInter.OnAdLoaded += (sender, args) =>
{
Debug.Log($"Ecpm: {args.Ad?.Ecpm}");
};

Below you can find all available events for interstitials.

event EventHandler<BidonAdLoadedEventArgs> OnAdLoaded;
event EventHandler<BidonAdLoadFailedEventArgs> OnAdLoadFailed;
event EventHandler<BidonAdShownEventArgs> OnAdShown;
event EventHandler<BidonAdShowFailedEventArgs> OnAdShowFailed;
event EventHandler<BidonAdClickedEventArgs> OnAdClicked;
event EventHandler<BidonAdClosedEventArgs> OnAdClosed;
event EventHandler<BidonAdExpiredEventArgs> OnAdExpired;
event EventHandler<BidonAdRevenueReceivedEventArgs> OnAdRevenueReceived;

Load

bidonInter.Load(0.01d);

Show

if (bidonInter.IsReady())
{
bidonInter.Show();
}

Dispose

To release resources we recommend destroying instances when you don't need them anymore.

bidonInter.Dispose();
bidonInter = null;

Send Extra Data

note

The value has to be one of the following types: bool, char, int, long, float, double, string.

Passing null as a value will remove existing KeyValuePair from dictionary.

bidonInter.SetExtraData("some_key", true);

You can also read all current extras as shown below:

var extras = bidonInter.GetExtraData();

Win / Loss Notifications

Use the following methods to let Bidon know whether or not it won the show opportunity.

bidonInter.NotifyWin();
bidonInter.NotifyLoss("winner_demand_id", (double)winnerEcpm);