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

Rewarded Ads

Load

Rewarded Ads start loading automatically right after creation an instance:

string rewardedIdentifier = BidappBinding.Instance.CreateRewarded();

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

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

BidappBinding.Instance.IsRewardedAdReady(rewardedIdentifier);

Show

To show an reward ad, call showRewarded instance function:

BidappBinding.Instance.ShowRewarded(rewardedIdentifier);

Destroy with resource release

Call the following function to destroy a rewarded:

BidappBinding.Instance.DestroyRewarded(rewardedIdentifier);

DestroyRewarded functions will also unregister all callback receiver instances, registered for the specified rewardedIdentifier

Callbacks / Delegates / Events

Register

To be able to register reward callbacks receiver you will need to inherit it from IBidappRewardedDelegate

public class BidappRewardedDelegate : IBidappRewardedDelegate

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

BidappSDKDelegate.Instance.SetRewardedDelegate(
    new BidappRewardedDelegate(),
    rewardedIdentifier
);

Observe

You can observe ad loading events in callbacks:

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

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

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

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

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

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

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

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

To be notified when user should be rewarded implement use callback:

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

Release

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

BidappSDKDelegate.Instance.SetRewardedDelegate(
    null,
    rewardedIdentifier
);
PreviousInterstitial AdsNextBanner Ads

Last updated 4 months ago

Was this helpful?