private void sendEvent(AdEventInfo eventInfo, float sessionTime) { if (isAdStartEvent(eventInfo)) { EventManager.Send(new OnAnalyticsAdStart(getScreen(eventInfo))); } else if (isAdEndEvent(eventInfo)) { EventManager.Send(new OnAnalyticsAdComplete(getScreen(eventInfo))); } }
public override void processAdEvent(AdEventInfo eventInfo) { if (isSpecialEvent(eventInfo)) { handleSpecialEvents(eventInfo); } else { sendEvent(eventInfo, currentSessionTime); } }
private bool isSpecialEvent(AdEventInfo eventInfo) { if (eventInfo.adType != AdType.Interstitial) { return(false); } foreach (var t in interstitialSpecialEvents) { if (eventInfo.eventType == t) { return(true); } } return(false); }
private void handleSpecialEvents(AdEventInfo eventInfo) { switch (eventInfo.eventType) { case AdEventType.INTERSTITIAL_AD_SHOW_REQUEST: mAdShowRequestResultPending = true; mAdShowRequestTime = currentSessionTime; break; case AdEventType.INTERSTITIAL_AD_OPENED: mAdShowRequestResultPending = false; sendEvent(eventInfo, mAdShowRequestTime); break; case AdEventType.INTERSTITIAL_AD_CLOSED: sendEvent(eventInfo, currentSessionTime); break; } }
private string getScreen(AdEventInfo eventInfo) { string typeString = ""; switch (eventInfo.adType) { case AdType.Banner: typeString = EventStrings.AD_SCREEN_BANNER; break; case AdType.Interstitial: typeString = EventStrings.AD_SCREEN_INTERSTITIAL; break; case AdType.RewardedAd: typeString = EventStrings.AD_SCREEN_REWARDED; break; } return(typeString); }
private void onAdEventHappened(AdEventInfo eventInfo) { showDebugInfo("onAdEventHappened", eventInfo.adType + " " + eventInfo.eventType); refs.eventInterpreter.processAdEvent(eventInfo); }
public abstract void processAdEvent(AdEventInfo eventInfo);
private static bool isAdStartEvent(AdEventInfo eventInfo) { return(eventInfo.eventType == AdEventType.REWARDED_AD_STARTED || eventInfo.eventType == AdEventType.BANNER_AD_SCREEN_PRESENTED || eventInfo.eventType == AdEventType.INTERSTITIAL_AD_OPENED); }
private static bool isAdEndEvent(AdEventInfo eventInfo) { return(eventInfo.eventType == AdEventType.REWARDED_AD_CLOSED || eventInfo.eventType == AdEventType.INTERSTITIAL_AD_CLOSED); }