Bidapp Ads
  • 🎁Ab_dout
  • Integration
    • iOS
      • Getting started
      • Additional Settings
      • App Policy Settings
      • Serverless Settings
      • Interstitial Ads
      • Rewarded Ads
      • Banner Ads
      • SKAdNetwork
      • SwiftUI
    • Android
      • Getting started
      • Additional Settings
      • App Policy Settings
      • Serverless Settings
      • Interstitial Ads
      • Rewarded Ads
      • Banner Ads
      • Jetpack Compose
  • PLUGINS
    • Kotlin Multiplatform
      • Getting started
      • Android Platform Setup
      • iOS Platfrom Setup
      • App Policy Settings
      • Interstitial Ads
      • Rewarded Ads
      • Banner Ads
    • Unreal Engine
      • Getting started
      • App Policy Settings
      • Interstitial Ads
      • Rewarded Ads
      • Banner Ads
      • MREC
    • Unity
      • Getting started
      • Android
      • iOS
      • App Policy Settings
      • Interstitial Ads
      • Rewarded Ads
      • Banner Ads
Powered by GitBook
On this page
  • Load
  • Show
  • Destroy with resource release
  • Callbacks / Delegates / Events
  • Register
  • Observe
  • Release

Was this helpful?

  1. PLUGINS
  2. Unity

Interstitial Ads

Load

Interstitial Ads start loading automatically right after creation an instance:

string interstitialIdentifier = BidappBinding.Instance.CreateInterstitial();

From creation function you will obtain an Interstitial Ad identifier that will be required to show and destroy ads, receive callbacks.

To check if Interstitial is Ready to be displayed you may use next function:

BidappBinding.Instance.IsInterstitialAdReady(interstitialIdentifier);

Show

To show an interstitial ad, call showInterstitial instance function and provide the interstitial identifier:

BidappBinding.Instance.ShowInterstitial(interstitialIdentifier);

Destroy with resource release

Call the following function to destroy interstitial:

BidappBinding.Instance.DestroyInterstitial(interstitialIdentifier);

DestroyInterstitial functions will also unregister all callback receiver instances, registered for the specified interstitialIdentifier

Callbacks / Delegates / Events

Register

To be able to register interstitial callbacks receiver you will need to inherit it from IBidappInterstitialDelegate

public class BidappInterstitialDelegate : IBidappInterstitialDelegate

Then you need to register receiver of the callbacks for interstitial instance identifier:

BidappSDKDelegate.Instance.SetInterstitialDelegate(
    new BidappInterstitialDelegate(), 
    interstitialIdentifier
);

Observe

You can observe ad loading events in callbacks:

public void OnInterstitialDidLoadAd(string identifier, string networkId)
{
    Debug.Log($"BIDUnity OnInterstitialDidLoadAd: interstitialId {identifier}, providerId: {networkId}");
}

public void OnInterstitialDidFailToLoadAd(string identifier, string networkId, string errorDescription)
{
    Debug.Log($"BIDUnity OnInterstitialDidFailToLoadAd: interstitialId {identifier}, providerId: {networkId}, errorDescription: {errorDescription}");
}

Events related to displaying interstitial ad can be observed in callbacks:

public void OnInterstitialDidDisplayAd(string identifier, string networkId)
{
    Debug.Log($"BIDUnity OnInterstitialDidDisplayAd: interstitialId {identifier}, providerId: {networkId}");
}

public void OnInterstitialDidClickAd(string identifier, string networkId)
{
    Debug.Log($"BIDUnity OnInterstitialDidClickAd: interstitialId {identifier}, providerId: {networkId}");
}

public void OnInterstitialDidHideAd(string identifier, string networkId)
{
    Debug.Log($"BIDUnity OnInterstitialDidHideAd: interstitialId {identifier}, providerId: {networkId}");
}

public void OnInterstitialDidFailToDisplayAd(string identifier, string networkId, string errorDescription)
{
    Debug.Log($"BIDUnity OnInterstitialDidFailToDisplayAd: interstitialId {identifier}, providerId: {networkId}, errorDescription: {errorDescription}");
}

public void OnInterstitialAllNetworksFailedToDisplayAd(string identifier)
{
    Debug.Log($"BIDUnity OnInterstitialAllNetworksFailedToDisplayAd: interstitialId {identifier}");
}

Release

If you don't want to receive callbacks anymore you can unregister callback receiver instance:

BidappSDKDelegate.Instance.SetInterstitialDelegate(
    null, 
    interstitialIdentifier
);
PreviousApp Policy SettingsNextRewarded Ads

Last updated 3 months ago

Was this helpful?