コード例 #1
0
        public AdjustEventFailure(Dictionary <string, string> eventFailureDataMap)
        {
            if (eventFailureDataMap == null)
            {
                return;
            }

            Adid       = AdjustUtils.TryGetValue(eventFailureDataMap, AdjustUtils.KeyAdid);
            Message    = AdjustUtils.TryGetValue(eventFailureDataMap, AdjustUtils.KeyMessage);
            Timestamp  = AdjustUtils.TryGetValue(eventFailureDataMap, AdjustUtils.KeyTimestamp);
            EventToken = AdjustUtils.TryGetValue(eventFailureDataMap, AdjustUtils.KeyEventToken);
            CallbackId = AdjustUtils.TryGetValue(eventFailureDataMap, AdjustUtils.KeyCallbackId);

            bool willRetry;

            if (bool.TryParse(AdjustUtils.TryGetValue(eventFailureDataMap, AdjustUtils.KeyWillRetry), out willRetry))
            {
                WillRetry = willRetry;
            }

            string jsonResponseString = AdjustUtils.TryGetValue(eventFailureDataMap, AdjustUtils.KeyJsonResponse);
            var    jsonResponseNode   = JSON.Parse(jsonResponseString);

            if (jsonResponseNode != null && jsonResponseNode.AsObject != null)
            {
                JsonResponse = new Dictionary <string, object>();
                AdjustUtils.WriteJsonResponseDictionary(jsonResponseNode.AsObject, JsonResponse);
            }
        }
コード例 #2
0
        public AdjustAttribution(Dictionary <string, string> dicAttributionData)
        {
            if (dicAttributionData == null)
            {
                return;
            }

            trackerName  = AdjustUtils.TryGetValue(dicAttributionData, AdjustUtils.KeyTrackerName);
            trackerToken = AdjustUtils.TryGetValue(dicAttributionData, AdjustUtils.KeyTrackerToken);
            network      = AdjustUtils.TryGetValue(dicAttributionData, AdjustUtils.KeyNetwork);
            campaign     = AdjustUtils.TryGetValue(dicAttributionData, AdjustUtils.KeyCampaign);
            adgroup      = AdjustUtils.TryGetValue(dicAttributionData, AdjustUtils.KeyAdgroup);
            creative     = AdjustUtils.TryGetValue(dicAttributionData, AdjustUtils.KeyCreative);
            clickLabel   = AdjustUtils.TryGetValue(dicAttributionData, AdjustUtils.KeyClickLabel);
            adid         = AdjustUtils.TryGetValue(dicAttributionData, AdjustUtils.KeyAdid);
            costType     = AdjustUtils.TryGetValue(dicAttributionData, AdjustUtils.KeyCostType);
            try
            {
                costAmount = double.Parse(AdjustUtils.TryGetValue(dicAttributionData, AdjustUtils.KeyCostAmount),
                                          System.Globalization.CultureInfo.InvariantCulture);
            }
            catch (Exception)
            {
                // attribution response doesn't contain cost amount attached
                // value will default to null
            }
            costCurrency = AdjustUtils.TryGetValue(dicAttributionData, AdjustUtils.KeyCostCurrency);
        }
コード例 #3
0
        public AdjustEventFailure(Dictionary <string, string> eventFailureDataMap)
        {
            if (eventFailureDataMap == null)
            {
                return;
            }
            this.Adid       = AdjustUtils.TryGetValue(eventFailureDataMap, AdjustUtils.KeyAdid);
            this.Message    = AdjustUtils.TryGetValue(eventFailureDataMap, AdjustUtils.KeyMessage);
            this.Timestamp  = AdjustUtils.TryGetValue(eventFailureDataMap, AdjustUtils.KeyTimestamp);
            this.EventToken = AdjustUtils.TryGetValue(eventFailureDataMap, AdjustUtils.KeyEventToken);
            this.WillRetry  = bool.Parse(AdjustUtils.TryGetValue(eventFailureDataMap, AdjustUtils.KeyWillRetry));
            bool willRetry;

            if (bool.TryParse(AdjustUtils.TryGetValue(eventFailureDataMap, AdjustUtils.KeyWillRetry), out willRetry))
            {
                this.WillRetry = willRetry;
            }
            string   aJSON    = AdjustUtils.TryGetValue(eventFailureDataMap, AdjustUtils.KeyJsonResponse);
            JSONNode jsonnode = JSON.Parse(aJSON);

            if (jsonnode != null && jsonnode.AsObject != null)
            {
                this.JsonResponse = new Dictionary <string, object>();
                AdjustUtils.WriteJsonResponseDictionary(jsonnode.AsObject, this.JsonResponse);
            }
        }
コード例 #4
0
        public AdjustEventFailure(string jsonString)
        {
            var jsonNode = JSON.Parse(jsonString);

            if (jsonNode == null)
            {
                return;
            }

            Adid       = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyAdid);
            Message    = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyMessage);
            Timestamp  = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyTimestamp);
            EventToken = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyEventToken);
            CallbackId = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyCallbackId);
            WillRetry  = Convert.ToBoolean(AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyWillRetry));

            var jsonResponseNode = jsonNode[AdjustUtils.KeyJsonResponse];

            if (jsonResponseNode == null)
            {
                return;
            }
            if (jsonResponseNode.AsObject == null)
            {
                return;
            }

            JsonResponse = new Dictionary <string, object>();
            AdjustUtils.WriteJsonResponseDictionary(jsonResponseNode.AsObject, JsonResponse);
        }
コード例 #5
0
        public AdjustEventSuccess(string jsonString)
        {
            var jsonNode = JSON.Parse(jsonString);

            if (jsonNode == null)
            {
                return;
            }

            Adid       = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyAdid);
            Message    = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyMessage);
            Timestamp  = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyTimestamp);
            EventToken = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyEventToken);

            var jsonResponseNode = jsonNode [AdjustUtils.KeyJsonResponse];

            if (jsonResponseNode == null)
            {
                return;
            }

            if (jsonResponseNode.AsObject == null)
            {
                return;
            }

            JsonResponse = new Dictionary <string, object> ();
            AdjustUtils.WriteJsonResponseDictionary(jsonResponseNode.AsObject, JsonResponse);
        }
コード例 #6
0
        public static void WriteJsonResponseDictionary(JSONClass jsonObject, Dictionary <string, object> output)
        {
            IEnumerator enumerator = jsonObject.GetEnumerator();

            try
            {
                while (enumerator.MoveNext())
                {
                    object obj = enumerator.Current;
                    KeyValuePair <string, JSONNode> keyValuePair = (KeyValuePair <string, JSONNode>)obj;
                    JSONClass asObject = keyValuePair.Value.AsObject;
                    string    key      = keyValuePair.Key;
                    if (asObject == null)
                    {
                        string value = keyValuePair.Value.Value;
                        output.Add(key, value);
                    }
                    else
                    {
                        Dictionary <string, object> dictionary = new Dictionary <string, object>();
                        output.Add(key, dictionary);
                        AdjustUtils.WriteJsonResponseDictionary(asObject, dictionary);
                    }
                }
            }
            finally
            {
                IDisposable disposable;
                if ((disposable = (enumerator as IDisposable)) != null)
                {
                    disposable.Dispose();
                }
            }
        }
コード例 #7
0
        public AdjustAttribution(string jsonString)
        {
            var jsonNode = JSON.Parse(jsonString);

            if (jsonNode == null)
            {
                return;
            }

            trackerName  = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyTrackerName);
            trackerToken = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyTrackerToken);
            network      = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyNetwork);
            campaign     = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyCampaign);
            adgroup      = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyAdgroup);
            creative     = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyCreative);
            clickLabel   = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyClickLabel);
            adid         = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyAdid);
            costType     = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyCostType);
            try
            {
                costAmount = double.Parse(AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyCostAmount),
                                          System.Globalization.CultureInfo.InvariantCulture);
            }
            catch (Exception)
            {
                // attribution response doesn't contain cost amount attached
                // value will default to null
            }
            costCurrency = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyCostCurrency);
        }
コード例 #8
0
        public AdjustEventFailure(string jsonString)
        {
            JSONNode jsonnode = JSON.Parse(jsonString);

            if (jsonnode == null)
            {
                return;
            }
            this.Adid       = AdjustUtils.GetJsonString(jsonnode, AdjustUtils.KeyAdid);
            this.Message    = AdjustUtils.GetJsonString(jsonnode, AdjustUtils.KeyMessage);
            this.Timestamp  = AdjustUtils.GetJsonString(jsonnode, AdjustUtils.KeyTimestamp);
            this.EventToken = AdjustUtils.GetJsonString(jsonnode, AdjustUtils.KeyEventToken);
            this.WillRetry  = Convert.ToBoolean(AdjustUtils.GetJsonString(jsonnode, AdjustUtils.KeyWillRetry));
            JSONNode jsonnode2 = jsonnode[AdjustUtils.KeyJsonResponse];

            if (jsonnode2 == null)
            {
                return;
            }
            if (jsonnode2.AsObject == null)
            {
                return;
            }
            this.JsonResponse = new Dictionary <string, object>();
            AdjustUtils.WriteJsonResponseDictionary(jsonnode2.AsObject, this.JsonResponse);
        }
コード例 #9
0
        public static void Start(AdjustConfig adjustConfig)
        {
            string appToken                              = adjustConfig.appToken != null ? adjustConfig.appToken : "ADJ_INVALID";
            string sceneName                             = adjustConfig.sceneName != null ? adjustConfig.sceneName : "ADJ_INVALID";
            string userAgent                             = adjustConfig.userAgent != null ? adjustConfig.userAgent : "ADJ_INVALID";
            string defaultTracker                        = adjustConfig.defaultTracker != null ? adjustConfig.defaultTracker : "ADJ_INVALID";
            string externalDeviceId                      = adjustConfig.externalDeviceId != null ? adjustConfig.externalDeviceId : "ADJ_INVALID";
            string environment                           = adjustConfig.environment.ToLowercaseString();
            long   info1                                 = AdjustUtils.ConvertLong(adjustConfig.info1);
            long   info2                                 = AdjustUtils.ConvertLong(adjustConfig.info2);
            long   info3                                 = AdjustUtils.ConvertLong(adjustConfig.info3);
            long   info4                                 = AdjustUtils.ConvertLong(adjustConfig.info4);
            long   secretId                              = AdjustUtils.ConvertLong(adjustConfig.secretId);
            double delayStart                            = AdjustUtils.ConvertDouble(adjustConfig.delayStart);
            int    logLevel                              = AdjustUtils.ConvertLogLevel(adjustConfig.logLevel);
            int    isDeviceKnown                         = AdjustUtils.ConvertBool(adjustConfig.isDeviceKnown);
            int    sendInBackground                      = AdjustUtils.ConvertBool(adjustConfig.sendInBackground);
            int    eventBufferingEnabled                 = AdjustUtils.ConvertBool(adjustConfig.eventBufferingEnabled);
            int    allowiAdInfoReading                   = AdjustUtils.ConvertBool(adjustConfig.allowiAdInfoReading);
            int    allowIdfaReading                      = AdjustUtils.ConvertBool(adjustConfig.allowIdfaReading);
            int    allowSuppressLogLevel                 = AdjustUtils.ConvertBool(adjustConfig.allowSuppressLogLevel);
            int    launchDeferredDeeplink                = AdjustUtils.ConvertBool(adjustConfig.launchDeferredDeeplink);
            int    isAttributionCallbackImplemented      = AdjustUtils.ConvertBool(adjustConfig.getAttributionChangedDelegate() != null);
            int    isEventSuccessCallbackImplemented     = AdjustUtils.ConvertBool(adjustConfig.getEventSuccessDelegate() != null);
            int    isEventFailureCallbackImplemented     = AdjustUtils.ConvertBool(adjustConfig.getEventFailureDelegate() != null);
            int    isSessionSuccessCallbackImplemented   = AdjustUtils.ConvertBool(adjustConfig.getSessionSuccessDelegate() != null);
            int    isSessionFailureCallbackImplemented   = AdjustUtils.ConvertBool(adjustConfig.getSessionFailureDelegate() != null);
            int    isDeferredDeeplinkCallbackImplemented = AdjustUtils.ConvertBool(adjustConfig.getDeferredDeeplinkDelegate() != null);

            _AdjustLaunchApp(
                appToken,
                environment,
                sdkPrefix,
                userAgent,
                defaultTracker,
                externalDeviceId,
                sceneName,
                allowSuppressLogLevel,
                logLevel,
                isDeviceKnown,
                eventBufferingEnabled,
                sendInBackground,
                allowiAdInfoReading,
                allowIdfaReading,
                secretId,
                info1,
                info2,
                info3,
                info4,
                delayStart,
                launchDeferredDeeplink,
                isAttributionCallbackImplemented,
                isEventSuccessCallbackImplemented,
                isEventFailureCallbackImplemented,
                isSessionSuccessCallbackImplemented,
                isSessionFailureCallbackImplemented,
                isDeferredDeeplinkCallbackImplemented);
        }
コード例 #10
0
		public void BuildJsonResponseFromString(string jsonResponseString)
		{
			JSONNode jsonnode = JSON.Parse(jsonResponseString);
			if (jsonnode == null)
			{
				return;
			}
			this.JsonResponse = new Dictionary<string, object>();
			AdjustUtils.WriteJsonResponseDictionary(jsonnode.AsObject, this.JsonResponse);
		}
コード例 #11
0
        public void BuildJsonResponseFromString(string jsonResponseString)
        {
            JSONNode jSONNode = JSON.Parse(jsonResponseString);

            if (!(jSONNode == null))
            {
                JsonResponse = new Dictionary <string, object>();
                AdjustUtils.WriteJsonResponseDictionary(jSONNode.AsObject, JsonResponse);
            }
        }
コード例 #12
0
        public void start(AdjustConfig adjustConfig)
        {
            string appToken    = adjustConfig.appToken;
            string sceneName   = adjustConfig.sceneName;
            string environment = adjustConfig.environment.lowercaseToString();

            int logLevel = AdjustUtils.ConvertLogLevel(adjustConfig.logLevel);
            int eventBufferingEnabled = AdjustUtils.ConvertBool(adjustConfig.eventBufferingEnabled);

            _AdjustLaunchApp(appToken, environment, sdkPrefix, logLevel, eventBufferingEnabled, sceneName);
        }
コード例 #13
0
        public static void TrackThirdPartySharing(AdjustThirdPartySharing thirdPartySharing)
        {
            int           enabled             = AdjustUtils.ConvertBool(thirdPartySharing.isEnabled);
            List <string> jsonGranularOptions = new List <string>();

            foreach (KeyValuePair <string, List <string> > entry in thirdPartySharing.granularOptions)
            {
                jsonGranularOptions.Add(entry.Key);
                jsonGranularOptions.Add(AdjustUtils.ConvertListToJson(entry.Value));
            }

            _AdjustTrackThirdPartySharing(enabled, AdjustUtils.ConvertListToJson(jsonGranularOptions));
        }
コード例 #14
0
        public static void TrackEvent(AdjustEvent adjustEvent)
        {
            int    isReceiptSet  = AdjustUtils.ConvertBool(adjustEvent.isReceiptSet);
            double revenue       = AdjustUtils.ConvertDouble(adjustEvent.revenue);
            string eventToken    = adjustEvent.eventToken;
            string currency      = adjustEvent.currency;
            string receipt       = adjustEvent.receipt;
            string transactionId = adjustEvent.transactionId;
            string stringJsonCallBackParameters = AdjustUtils.ConvertListToJson(adjustEvent.callbackList);
            string stringJsonPartnerParameters  = AdjustUtils.ConvertListToJson(adjustEvent.partnerList);

            _AdjustTrackEvent(eventToken, revenue, currency, receipt, transactionId, isReceiptSet, stringJsonCallBackParameters, stringJsonPartnerParameters);
        }
コード例 #15
0
 public AdjustAttribution(Dictionary <string, string> dicAttributionData)
 {
     if (dicAttributionData != null)
     {
         trackerName  = AdjustUtils.TryGetValue(dicAttributionData, AdjustUtils.KeyTrackerName);
         trackerToken = AdjustUtils.TryGetValue(dicAttributionData, AdjustUtils.KeyTrackerToken);
         network      = AdjustUtils.TryGetValue(dicAttributionData, AdjustUtils.KeyNetwork);
         campaign     = AdjustUtils.TryGetValue(dicAttributionData, AdjustUtils.KeyCampaign);
         adgroup      = AdjustUtils.TryGetValue(dicAttributionData, AdjustUtils.KeyAdgroup);
         creative     = AdjustUtils.TryGetValue(dicAttributionData, AdjustUtils.KeyCreative);
         clickLabel   = AdjustUtils.TryGetValue(dicAttributionData, AdjustUtils.KeyClickLabel);
         adid         = AdjustUtils.TryGetValue(dicAttributionData, AdjustUtils.KeyAdid);
     }
 }
コード例 #16
0
 public AdjustSessionSuccess(Dictionary <string, string> sessionSuccessDataMap)
 {
     if (sessionSuccessDataMap != null)
     {
         Adid      = AdjustUtils.TryGetValue(sessionSuccessDataMap, AdjustUtils.KeyAdid);
         Message   = AdjustUtils.TryGetValue(sessionSuccessDataMap, AdjustUtils.KeyMessage);
         Timestamp = AdjustUtils.TryGetValue(sessionSuccessDataMap, AdjustUtils.KeyTimestamp);
         string   aJSON    = AdjustUtils.TryGetValue(sessionSuccessDataMap, AdjustUtils.KeyJsonResponse);
         JSONNode jSONNode = JSON.Parse(aJSON);
         if (jSONNode != null && jSONNode.AsObject != null)
         {
             JsonResponse = new Dictionary <string, object>();
             AdjustUtils.WriteJsonResponseDictionary(jSONNode.AsObject, JsonResponse);
         }
     }
 }
コード例 #17
0
        // Token: 0x060000BF RID: 191 RVA: 0x00005D38 File Offset: 0x00004138
        public AdjustAttribution(string jsonString)
        {
            JSONNode jsonnode = JSON.Parse(jsonString);

            if (jsonnode == null)
            {
                return;
            }
            this.trackerName  = AdjustUtils.GetJsonString(jsonnode, AdjustUtils.KeyTrackerName);
            this.trackerToken = AdjustUtils.GetJsonString(jsonnode, AdjustUtils.KeyTrackerToken);
            this.network      = AdjustUtils.GetJsonString(jsonnode, AdjustUtils.KeyNetwork);
            this.campaign     = AdjustUtils.GetJsonString(jsonnode, AdjustUtils.KeyCampaign);
            this.adgroup      = AdjustUtils.GetJsonString(jsonnode, AdjustUtils.KeyAdgroup);
            this.creative     = AdjustUtils.GetJsonString(jsonnode, AdjustUtils.KeyCreative);
            this.clickLabel   = AdjustUtils.GetJsonString(jsonnode, AdjustUtils.KeyClickLabel);
        }
コード例 #18
0
        public AdjustAttribution(string jsonString)
        {
            JSONNode jSONNode = JSON.Parse(jsonString);

            if (!(jSONNode == null))
            {
                trackerName  = AdjustUtils.GetJsonString(jSONNode, AdjustUtils.KeyTrackerName);
                trackerToken = AdjustUtils.GetJsonString(jSONNode, AdjustUtils.KeyTrackerToken);
                network      = AdjustUtils.GetJsonString(jSONNode, AdjustUtils.KeyNetwork);
                campaign     = AdjustUtils.GetJsonString(jSONNode, AdjustUtils.KeyCampaign);
                adgroup      = AdjustUtils.GetJsonString(jSONNode, AdjustUtils.KeyAdgroup);
                creative     = AdjustUtils.GetJsonString(jSONNode, AdjustUtils.KeyCreative);
                clickLabel   = AdjustUtils.GetJsonString(jSONNode, AdjustUtils.KeyClickLabel);
                adid         = AdjustUtils.GetJsonString(jSONNode, AdjustUtils.KeyAdid);
            }
        }
コード例 #19
0
        public void start(AdjustConfig adjustConfig)
        {
            string appToken    = adjustConfig.appToken;
            string sceneName   = adjustConfig.sceneName;
            string userAgent   = adjustConfig.userAgent != null ? adjustConfig.userAgent : String.Empty;
            string environment = adjustConfig.environment.lowercaseToString();

            double delayStart = AdjustUtils.ConvertDouble(adjustConfig.delayStart);

            int logLevel               = AdjustUtils.ConvertLogLevel(adjustConfig.logLevel);
            int sendInBackground       = AdjustUtils.ConvertBool(adjustConfig.sendInBackground);
            int eventBufferingEnabled  = AdjustUtils.ConvertBool(adjustConfig.eventBufferingEnabled);
            int allowSuppressLogLevel  = AdjustUtils.ConvertBool(adjustConfig.allowSuppressLogLevel);
            int launchDeferredDeeplink = AdjustUtils.ConvertBool(adjustConfig.launchDeferredDeeplink);

            _AdjustLaunchApp(appToken, environment, sdkPrefix, allowSuppressLogLevel, logLevel, eventBufferingEnabled, sendInBackground, delayStart, userAgent, launchDeferredDeeplink, sceneName);
        }
コード例 #20
0
        public AdjustSessionSuccess(string jsonString)
        {
            JSONNode jSONNode = JSON.Parse(jsonString);

            if (!(jSONNode == null))
            {
                Adid      = AdjustUtils.GetJsonString(jSONNode, AdjustUtils.KeyAdid);
                Message   = AdjustUtils.GetJsonString(jSONNode, AdjustUtils.KeyMessage);
                Timestamp = AdjustUtils.GetJsonString(jSONNode, AdjustUtils.KeyTimestamp);
                JSONNode jSONNode2 = jSONNode[AdjustUtils.KeyJsonResponse];
                if (!(jSONNode2 == null) && !(jSONNode2.AsObject == null))
                {
                    JsonResponse = new Dictionary <string, object>();
                    AdjustUtils.WriteJsonResponseDictionary(jSONNode2.AsObject, JsonResponse);
                }
            }
        }
コード例 #21
0
        public static string GetJsonResponseCompact(Dictionary <string, object> dictionary)
        {
            string text = string.Empty;

            if (dictionary == null)
            {
                return(text);
            }
            int num = 0;

            text += "{";
            foreach (KeyValuePair <string, object> keyValuePair in dictionary)
            {
                string text2 = keyValuePair.Value as string;
                if (text2 != null)
                {
                    if (++num > 1)
                    {
                        text += ",";
                    }
                    string text3 = text;
                    text = string.Concat(new string[]
                    {
                        text3,
                        "\"",
                        keyValuePair.Key,
                        "\":\"",
                        text2,
                        "\""
                    });
                }
                else
                {
                    Dictionary <string, object> dictionary2 = keyValuePair.Value as Dictionary <string, object>;
                    if (++num > 1)
                    {
                        text += ",";
                    }
                    text  = text + "\"" + keyValuePair.Key + "\":";
                    text += AdjustUtils.GetJsonResponseCompact(dictionary2);
                }
            }
            text += "}";
            return(text);
        }
コード例 #22
0
        public AdjustEventSuccess(Dictionary <string, string> eventSuccessDataMap)
        {
            if (eventSuccessDataMap == null)
            {
                return;
            }
            this.Adid       = AdjustUtils.TryGetValue(eventSuccessDataMap, AdjustUtils.KeyAdid);
            this.Message    = AdjustUtils.TryGetValue(eventSuccessDataMap, AdjustUtils.KeyMessage);
            this.Timestamp  = AdjustUtils.TryGetValue(eventSuccessDataMap, AdjustUtils.KeyTimestamp);
            this.EventToken = AdjustUtils.TryGetValue(eventSuccessDataMap, AdjustUtils.KeyEventToken);
            string   aJSON    = AdjustUtils.TryGetValue(eventSuccessDataMap, AdjustUtils.KeyJsonResponse);
            JSONNode jsonnode = JSON.Parse(aJSON);

            if (jsonnode != null && jsonnode.AsObject != null)
            {
                this.JsonResponse = new Dictionary <string, object>();
                AdjustUtils.WriteJsonResponseDictionary(jsonnode.AsObject, this.JsonResponse);
            }
        }
コード例 #23
0
 public AdjustSessionFailure(Dictionary <string, string> sessionFailureDataMap)
 {
     if (sessionFailureDataMap != null)
     {
         Adid      = AdjustUtils.TryGetValue(sessionFailureDataMap, AdjustUtils.KeyAdid);
         Message   = AdjustUtils.TryGetValue(sessionFailureDataMap, AdjustUtils.KeyMessage);
         Timestamp = AdjustUtils.TryGetValue(sessionFailureDataMap, AdjustUtils.KeyTimestamp);
         if (bool.TryParse(AdjustUtils.TryGetValue(sessionFailureDataMap, AdjustUtils.KeyWillRetry), out bool result))
         {
             WillRetry = result;
         }
         string   aJSON    = AdjustUtils.TryGetValue(sessionFailureDataMap, AdjustUtils.KeyJsonResponse);
         JSONNode jSONNode = JSON.Parse(aJSON);
         if (jSONNode != null && jSONNode.AsObject != null)
         {
             JsonResponse = new Dictionary <string, object>();
             AdjustUtils.WriteJsonResponseDictionary(jSONNode.AsObject, JsonResponse);
         }
     }
 }
コード例 #24
0
        public AdjustSessionSuccess(Dictionary <string, string> sessionSuccessDataMap)
        {
            if (sessionSuccessDataMap == null)
            {
                return;
            }

            Adid      = AdjustUtils.TryGetValue(sessionSuccessDataMap, AdjustUtils.KeyAdid);
            Message   = AdjustUtils.TryGetValue(sessionSuccessDataMap, AdjustUtils.KeyMessage);
            Timestamp = AdjustUtils.TryGetValue(sessionSuccessDataMap, AdjustUtils.KeyTimestamp);

            string jsonResponseString = AdjustUtils.TryGetValue(sessionSuccessDataMap, AdjustUtils.KeyJsonResponse);
            var    jsonResponseNode   = JSON.Parse(jsonResponseString);

            if (jsonResponseNode != null && jsonResponseNode.AsObject != null)
            {
                JsonResponse = new Dictionary <string, object>();
                AdjustUtils.WriteJsonResponseDictionary(jsonResponseNode.AsObject, JsonResponse);
            }
        }
コード例 #25
0
ファイル: AdjustiOS.cs プロジェクト: midgithub/nonetitle
        public void start(AdjustConfig adjustConfig)
        {
            string appToken    = adjustConfig.appToken;
            string sceneName   = adjustConfig.sceneName;
            string userAgent   = adjustConfig.userAgent != null ? adjustConfig.userAgent : String.Empty;
            string environment = adjustConfig.environment.lowercaseToString();

            double delayStart = AdjustUtils.ConvertDouble(adjustConfig.delayStart);

            int logLevel               = AdjustUtils.ConvertLogLevel(adjustConfig.logLevel);
            int sendInBackground       = AdjustUtils.ConvertBool(adjustConfig.sendInBackground);
            int eventBufferingEnabled  = AdjustUtils.ConvertBool(adjustConfig.eventBufferingEnabled);
            int allowSuppressLogLevel  = AdjustUtils.ConvertBool(adjustConfig.allowSuppressLogLevel);
            int launchDeferredDeeplink = AdjustUtils.ConvertBool(adjustConfig.launchDeferredDeeplink);

            int isAttributionCallbackImplemented      = AdjustUtils.ConvertBool(adjustConfig.getAttributionChangedDelegate() != null);
            int isEventSuccessCallbackImplemented     = AdjustUtils.ConvertBool(adjustConfig.getEventSuccessDelegate() != null);
            int isEventFailureCallbackImplemented     = AdjustUtils.ConvertBool(adjustConfig.getEventFailureDelegate() != null);
            int isSessionSuccessCallbackImplemented   = AdjustUtils.ConvertBool(adjustConfig.getSessionSuccessDelegate() != null);
            int isSessionFailureCallbackImplemented   = AdjustUtils.ConvertBool(adjustConfig.getSessionFailureDelegate() != null);
            int isDeferredDeeplinkCallbackImplemented = AdjustUtils.ConvertBool(adjustConfig.getDeferredDeeplinkDelegate() != null);

            _AdjustLaunchApp(
                appToken,
                environment,
                sdkPrefix,
                allowSuppressLogLevel,
                logLevel,
                eventBufferingEnabled,
                sendInBackground,
                delayStart,
                userAgent,
                launchDeferredDeeplink,
                sceneName,
                isAttributionCallbackImplemented,
                isEventSuccessCallbackImplemented,
                isEventFailureCallbackImplemented,
                isSessionSuccessCallbackImplemented,
                isSessionFailureCallbackImplemented,
                isDeferredDeeplinkCallbackImplemented);
        }
コード例 #26
0
ファイル: AdjustiOS.cs プロジェクト: matteocoletta/unity_sdk
        public static void SetTestOptions(AdjustTestOptions testOptions)
        {
            long timerIntervalMls = testOptions.TimerIntervalInMilliseconds.HasValue ? testOptions.TimerIntervalInMilliseconds.Value : -1;
            long timerStartMls    = testOptions.TimerStartInMilliseconds.HasValue ? testOptions.TimerStartInMilliseconds.Value : -1;
            long sessionIntMls    = testOptions.SessionIntervalInMilliseconds.HasValue ? testOptions.SessionIntervalInMilliseconds.Value : -1;
            long subsessionIntMls = testOptions.SubsessionIntervalInMilliseconds.HasValue ? testOptions.SubsessionIntervalInMilliseconds.Value : -1;
            bool teardown         = testOptions.Teardown.HasValue ? testOptions.Teardown.Value : false;
            bool deleteState      = testOptions.DeleteState.HasValue ? testOptions.DeleteState.Value : false;

            _AdjustSetTestOptions(
                testOptions.BaseUrl,
                testOptions.BasePath,
                testOptions.GdprUrl,
                testOptions.GdprPath,
                timerIntervalMls,
                timerStartMls,
                sessionIntMls,
                subsessionIntMls,
                AdjustUtils.ConvertBool(teardown),
                AdjustUtils.ConvertBool(deleteState));
        }
コード例 #27
0
        public static void TrackAppStoreSubscription(AdjustAppStoreSubscription subscription)
        {
            string price           = subscription.price;
            string currency        = subscription.currency;
            string transactionId   = subscription.transactionId;
            string receipt         = subscription.receipt;
            string billingStore    = subscription.billingStore;
            string transactionDate = subscription.transactionDate;
            string salesRegion     = subscription.salesRegion;
            string stringJsonCallbackParameters = AdjustUtils.ConvertListToJson(subscription.callbackList);
            string stringJsonPartnerParameters  = AdjustUtils.ConvertListToJson(subscription.partnerList);

            _AdjustTrackAppStoreSubscription(
                price,
                currency,
                transactionId,
                receipt,
                billingStore,
                transactionDate,
                salesRegion,
                stringJsonCallbackParameters,
                stringJsonPartnerParameters);
        }
コード例 #28
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);
        }
コード例 #29
0
        public AdjustSessionSuccess(string jsonString)
        {
            JSONNode jsonnode = JSON.Parse(jsonString);

            if (jsonnode == null)
            {
                return;
            }
            this.Adid      = AdjustUtils.GetJsonString(jsonnode, AdjustUtils.KeyAdid);
            this.Message   = AdjustUtils.GetJsonString(jsonnode, AdjustUtils.KeyMessage);
            this.Timestamp = AdjustUtils.GetJsonString(jsonnode, AdjustUtils.KeyTimestamp);
            JSONNode jsonnode2 = jsonnode[AdjustUtils.KeyJsonResponse];

            if (jsonnode2 == null)
            {
                return;
            }
            if (jsonnode2.AsObject == null)
            {
                return;
            }
            this.JsonResponse = new Dictionary <string, object>();
            AdjustUtils.WriteJsonResponseDictionary(jsonnode2.AsObject, this.JsonResponse);
        }
コード例 #30
0
        // Used for testing only.
        public static void SetTestOptions(Dictionary <string, string> testOptions)
        {
            AndroidJavaObject ajoTestOptions = AdjustUtils.TestOptionsMap2AndroidJavaObject(testOptions, ajoCurrentActivity);

            ajcAdjust.CallStatic("setTestOptions", ajoTestOptions);
        }