Ejemplo n.º 1
0
        public static void trackAdRevenue(AdjustAdRevenue adRevenue)
        {
            if (IsEditor())
            {
                return;
            }

#if UNITY_IOS
            AdjustiOS.TrackAdRevenue(adRevenue);
#elif UNITY_ANDROID
            AdjustAndroid.TrackAdRevenue(adRevenue);
#elif (UNITY_WSA || UNITY_WP8)
            Debug.Log("[Adjust]: Ad revenue tracking is only supported for Android and iOS platforms.");
#else
            Debug.Log(errorMsgPlatform);
#endif
        }
Ejemplo n.º 2
0
        public static void TrackAdRevenue(AdjustAdRevenue adRevenue)
        {
            string source                       = adRevenue.source;
            double revenue                      = AdjustUtils.ConvertDouble(adRevenue.revenue);
            string currency                     = adRevenue.currency;
            int    adImpressionsCount           = AdjustUtils.ConvertInt(adRevenue.adImpressionsCount);
            string adRevenueNetwork             = adRevenue.adRevenueNetwork;
            string adRevenueUnit                = adRevenue.adRevenueUnit;
            string adRevenuePlacement           = adRevenue.adRevenuePlacement;
            string stringJsonCallbackParameters = AdjustUtils.ConvertListToJson(adRevenue.callbackList);
            string stringJsonPartnerParameters  = AdjustUtils.ConvertListToJson(adRevenue.partnerList);

            _AdjustTrackAdRevenueNew(
                source,
                revenue,
                currency,
                adImpressionsCount,
                adRevenueNetwork,
                adRevenueUnit,
                adRevenuePlacement,
                stringJsonCallbackParameters,
                stringJsonPartnerParameters);
        }
Ejemplo n.º 3
0
        public static void TrackAdRevenue(AdjustAdRevenue adRevenue)
        {
            AndroidJavaObject ajoAdjustAdRevenue = new AndroidJavaObject("com.adjust.sdk.AdjustAdRevenue", adRevenue.source);

            // Check if user has set revenue.
            if (adRevenue.revenue != null)
            {
                AndroidJavaObject ajoRevenue = new AndroidJavaObject("java.lang.Double", adRevenue.revenue);
                ajoAdjustAdRevenue.Call("setRevenue", ajoRevenue, adRevenue.currency);
            }

            // Check if user has set ad impressions count.
            if (adRevenue.adImpressionsCount != null)
            {
                AndroidJavaObject ajoAdImpressionsCount = new AndroidJavaObject("java.lang.Integer", adRevenue.adImpressionsCount);
                ajoAdjustAdRevenue.Call("setAdImpressionsCount", ajoAdImpressionsCount);
            }

            // Check if user has set ad revenue network.
            if (adRevenue.adRevenueNetwork != null)
            {
                ajoAdjustAdRevenue.Call("setAdRevenueNetwork", adRevenue.adRevenueNetwork);
            }

            // Check if user has set ad revenue unit.
            if (adRevenue.adRevenueUnit != null)
            {
                ajoAdjustAdRevenue.Call("setAdRevenueUnit", adRevenue.adRevenueUnit);
            }

            // Check if user has set ad revenue placement.
            if (adRevenue.adRevenuePlacement != null)
            {
                ajoAdjustAdRevenue.Call("setAdRevenuePlacement", adRevenue.adRevenuePlacement);
            }

            // Check if user has added any callback parameters.
            if (adRevenue.callbackList != null)
            {
                for (int i = 0; i < adRevenue.callbackList.Count; i += 2)
                {
                    string key   = adRevenue.callbackList[i];
                    string value = adRevenue.callbackList[i + 1];
                    ajoAdjustAdRevenue.Call("addCallbackParameter", key, value);
                }
            }

            // Check if user has added any partner parameters.
            if (adRevenue.partnerList != null)
            {
                for (int i = 0; i < adRevenue.partnerList.Count; i += 2)
                {
                    string key   = adRevenue.partnerList[i];
                    string value = adRevenue.partnerList[i + 1];
                    ajoAdjustAdRevenue.Call("addPartnerParameter", key, value);
                }
            }

            // Track ad revenue.
            ajcAdjust.CallStatic("trackAdRevenue", ajoAdjustAdRevenue);
        }