1. Set Interstitial Ads Callback
Yodo1U3dAdsSDK.setInterstitialAdDelegate((Yodo1U3dAdsConstants.AdEvent adEvent, string error) => { Debug.Log("[Yodo1 Ads] InterstitialAdDelegate:" + adEvent + "\n" + error); switch (adEvent) { case Yodo1U3dAdsConstants.AdEvent.AdEventClick: Debug.Log("[Yodo1 Ads] Interstital advertising has been clicked."); break; case Yodo1U3dAdsConstants.AdEvent.AdEventClose: Debug.Log("[Yodo1 Ads] Interstital advertising has been closed."); break; case Yodo1U3dAdsConstants.AdEvent.AdEventShowSuccess: Debug.Log("[Yodo1 Ads] Interstital advertising has been shown."); break; case Yodo1U3dAdsConstants.AdEvent.AdEventShowFail: Debug.Log("[Yodo1 Ads] Interstital advertising show failed, the error message:" + error); break; } });
2. Check Interstitial Loading Status
bool isLoaded = Yodo1U3dAds.InterstitialIsReady();
3. Show Interstitial Ads
Yodo1U3dAds.ShowInterstitial();
4. Code Implementation
Below is an example of the implementation of banners from our sample project. You can find the new project here.
First, this function is triggered when an insterstitial should show in the UI.
(ConsoleText.text is a Text object, if you don't please need just comment this line.)
Second, the InterstitialEvents() function is triggered. This sets in motion the callbacks for the intersitial ads, which track what happens when the ad is filled, including the user interaction and whether or not the ad is shown successfully.
Comments
0 comments
Article is closed for comments.