// TODO Blocking Time default public void requestStrategy(IGoedleDownloadBuffer goedleDownloadBuffer) { GoedleUtils gu = new GoedleUtils(); string url = gu.getStrategyUrl(_app_key); _gio_http_client.requestStrategy(url, this, _gwr, goedleDownloadBuffer, _staging); }
public void track(string event_name, string event_id, string event_value, bool launch, string trait_key, string trait_value, IGoedleUploadHandler goedleUploadHandler) { if (!_adaptation_only && GoedleUtils.isStringUsable(_api_key) && GoedleUtils.isStringUsable(_app_key)) { bool ga_active = !String.IsNullOrEmpty(_ga_tracking_id); string authentication = null; string content = null; int ts = getTimeStamp(); // -1 because c# returns -1 for UTC +1 , * 1000 from Seconds to Milliseconds int timezone = (int)(((DateTime.UtcNow - DateTime.Now).TotalSeconds) * -1 * 1000); GoedleAtom rt = new GoedleAtom(_app_key, _user_id, ts, event_name, event_id, event_value, timezone, _app_version, _anonymous_id, trait_key, trait_value, ga_active); if (rt == null) { Console.Write("Data Object is None, there must be an error in the SDK!"); return; } else { content = rt.getGoedleAtomDictionary().ToString(); authentication = _goedleUtils.encodeToUrlParameter(content, _api_key); } string url = GoedleConstants.TRACK_URL; goedleUploadHandler.add(content); _gio_http_client.sendPost(url, authentication, _gwr, goedleUploadHandler, _staging); // Sending tp Google Analytics for now we only support the Event tracking string type = "event"; if (ga_active) { trackGoogleAnalytics(event_name, event_id, event_value, type); } } }
public void TestCreateUserHash() { Regex regex = new Regex(@"[[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"); string hash = GoedleUtils.userHash("hash"); Match match = regex.Match(hash); Assert.IsTrue(match.Success); }
public void TestFloatorInt() { GoedleUtils g_utils = new GoedleUtils(); Assert.IsFalse(g_utils.IsFloatOrInt("a1234")); Assert.IsFalse(g_utils.IsFloatOrInt("0x1234")); Assert.IsTrue(g_utils.IsFloatOrInt("1234")); Assert.IsTrue(g_utils.IsFloatOrInt("12.34")); }