private void handleAdShow(bool isRewaredAd, JsonData jsonData) { AdShowListener adShowListener = isRewaredAd ? rewardedAdShowListener : interstitialAdShowListener; if (adShowListener == null) { return; } int showStatus = (int)jsonData["showStatus"]; switch (showStatus) { case AD_SHOW_FAILED: adShowListener.onAdShowFailed((string)jsonData["unitId"], (int)jsonData["errCode"], (string)jsonData["errMessage"]); break; case AD_SHOW_IMPRESSION: adShowListener.onAdImpression((string)jsonData["unitId"], (string)jsonData["adSourceName"]); break; case AD_SHOW_CLICKED: adShowListener.onAdClicked((string)jsonData["unitId"], (string)jsonData["adSourceName"]); break; case AD_SHOW_REWARDED: adShowListener.onAdRewarded((string)jsonData["unitId"], (string)jsonData["adSourceName"]); break; case AD_SHOW_CLOSED: adShowListener.onAdClosed((string)jsonData["unitId"], (string)jsonData["adSourceName"], (bool)jsonData["hasRewarded"]); break; } }
public void showRewardedAdByWrapper(string wrapperId, AdShowListener adShowListener) { rewardedAdShowListener = adShowListener; instance.showRewardedAdByWrapper(wrapperId); }
public void showRewardedAd(string unitId, AdShowListener adShowListener) { rewardedAdShowListener = adShowListener; instance.showRewardedAd(unitId); }
public void showInterstitialAdByWrapper(string wrapperId, AdShowListener adShowListener) { interstitialAdShowListener = adShowListener; instance.showInterstitialAdByWrapper(wrapperId); }
public void showInterstitialAd(string unitId, AdShowListener adShowListener) { interstitialAdShowListener = adShowListener; instance.showInterstitialAd(unitId); }