public static BuildUrl ( string action, string eventName, double revenue, string currency, string refId, List |
||
action | string | |
eventName | string | |
revenue | double | |
currency | string | |
refId | string | |
eventItems | List |
|
parameters | MobileAppTracking.MATParameters | |
return | string |
// Add a url to event queue to send later internal void ProcessTrackingRequest(string action, string eventName, double revenue, string currency, string refId, List <MATEventItem> eventItems, MATParameters paramCopy) { Debug.WriteLine("Processing tracking request"); lock (syncLock) { Task.Factory.StartNew(() => { DumpQueue(); string url = MATUrlBuilder.BuildUrl(action, eventName, revenue, currency, refId, eventItems, paramCopy); AddToQueue(url, 0); DumpQueue(); }); } }
// Add a url to event queue to send later internal void ProcessTrackingRequest(string action, string eventName, double revenue, string currency, string refId, List <MATEventItem> eventItems, MATParameters paramCopy) { Debug.WriteLine("Processing tracking request"); lock (syncLock) { Task.Factory.StartNew(() => { DumpQueue(); string url = MATUrlBuilder.BuildUrl(action, eventName, revenue, currency, refId, eventItems, paramCopy); // Convert event items to correct JSON var jsonData = JsonConvert.SerializeObject(new { data = eventItems }, Formatting.None); AddToQueue(url, jsonData, 0); DumpQueue(); }); } }
internal void ProcessTrackingRequest(string action, string eventName, double revenue, string currency, string refId, List <MATEventItem> eventItems, Parameters copy) { lock (syncLock) { if (queueThread == null || !queueThread.IsAlive) { queueThread = new Thread(delegate() //Start on separate thread to avoid slowdown { DumpQueue(); //Clear anything from the last dump List <MATUrlBuilder.URLInfo> eventQueue; // Get existing event queue or create new one if (IsolatedStorageSettings.ApplicationSettings.Contains(SETTINGS_MATEVENTQUEUE_KEY) && IsolatedStorageSettings.ApplicationSettings[SETTINGS_MATEVENTQUEUE_KEY].GetType() == typeof(List <MATUrlBuilder.URLInfo>)) { eventQueue = (List <MATUrlBuilder.URLInfo>)IsolatedStorageSettings.ApplicationSettings[SETTINGS_MATEVENTQUEUE_KEY]; } else // No existing queue, create { IsolatedStorageSettings.ApplicationSettings.Remove(SETTINGS_MATEVENTQUEUE_KEY); eventQueue = new List <MATUrlBuilder.URLInfo>(); } MATUrlBuilder.URLInfo url = MATUrlBuilder.BuildUrl(action, eventName, revenue, currency, refId, eventItems, copy); eventQueue.Add(url); SaveLocalSetting(SETTINGS_MATEVENTQUEUE_KEY, eventQueue); if (parameters.matResponse != null) { parameters.matResponse.EnqueuedActionWithRefId(refId); } DumpQueue(); }); queueThread.Start(); } } }