Ejemplo n.º 1
0
        private void OnAdResponse(string jsonParams)
        {
            var data   = NimbusIOSParser.ParseMessage <NimbusIOSAdResponse>(jsonParams);
            var adUnit = AdUnitForInstanceID(data.adUnitInstanceID);

            if (adUnit == null)
            {
                Debug.unityLogger.LogError("NimbusError", "AdUnit not found: " + data.adUnitInstanceID);
                return;
            }

            adUnit.ResponseMetaData = new MetaData(data);
        }
Ejemplo n.º 2
0
        internal void OnAdRendered(string jsonParams)
        {
            var data   = NimbusIOSParser.ParseMessage <NimbusIOSParams>(jsonParams);
            var adUnit = AdUnitForInstanceID(data.adUnitInstanceID);

            if (adUnit == null)
            {
                Debug.unityLogger.LogError("NimbusError", "AdUnit not found: " + data.adUnitInstanceID);
                return;
            }

            adUnit.AdWasRendered = true;
            adUnit.EmitOnAdRendered(adUnit);
        }
Ejemplo n.º 3
0
        internal void OnAdEvent(string jsonParams)
        {
            var data   = NimbusIOSParser.ParseMessage <NimbusIOSAdEventData>(jsonParams);
            var adUnit = AdUnitForInstanceID(data.adUnitInstanceID);

            if (adUnit == null)
            {
                Debug.unityLogger.LogError("NimbusError", "AdUnit not found: " + data.adUnitInstanceID);
                return;
            }

            var eventType = (AdEventTypes)Enum.Parse(typeof(AdEventTypes), data.eventName, true);

            adUnit.EmitOnAdEvent(eventType);
        }
Ejemplo n.º 4
0
        internal void OnError(string jsonParams)
        {
            var data   = NimbusIOSParser.ParseMessage <NimbusIOSErrorData>(jsonParams);
            var adUnit = AdUnitForInstanceID(data.adUnitInstanceID);

            if (adUnit == null)
            {
                Debug.unityLogger.LogError("NimbusError", "AdUnit not found: " + data.adUnitInstanceID);
                return;
            }

            Debug.unityLogger.LogError("NimbusError", "Listener Ad error: " + data.errorMessage);
            adUnit.AdListenerError = new AdError(data.errorMessage);
            adUnit.EmitOnAdError(adUnit);
        }