Пример #1
0
        private async void Launched()
        {
            //create the Countly init object
            CountlySDK.CountlyCommon.CountlyBase.IsLoggingEnabled = true;
            var cc = new CountlyConfig
            {
                serverUrl  = "SERVER_URL",
                appKey     = "APP_KEY",
                appVersion = "1.2.3",
            };

            try
            {
                await Countly.Instance.Init(cc);

                await Countly.Instance.SessionBegin();

                await Countly.RecordEvent("qwedqwe");

                await Countly.Instance.RecordView("Some View");
            }
            catch (Exception exception)
            {
                Debug.WriteLine("Some exception found!" + exception);
            }
        }
        public async void ChengeDeviceIDNoMergeMultiple()
        {
            bool res;

            String dId = await Countly.Instance.DeviceData.GetDeviceId();

            Assert.NotNull(dId);
            Assert.NotEqual(0, dId.Length);

            String newId = "qweqwe";

            await Countly.Instance.ChangeDeviceId(newId + "1", false);

            res = await Countly.RecordEvent("Some event user2", 123);

            await Countly.Instance.ChangeDeviceId(newId + "2", false);

            res = await Countly.RecordEvent("Some event user2", 123);

            await Countly.Instance.ChangeDeviceId(newId + "3", false);

            res = await Countly.RecordEvent("Some event user2", 123);

            await Countly.Instance.ChangeDeviceId(newId + "4", false);

            res = await Countly.RecordEvent("Some event user2", 123);

            Assert.True(res);
        }
        public async void MultipleEvents()
        {
            bool res;

            res = await Countly.RecordEvent("Some event0");

            Assert.True(res);

            res = await Countly.RecordEvent("Some event1", 123);

            Assert.True(res);

            res = await Countly.RecordEvent("Some event2", 123, 456);

            Assert.True(res);

            res = await Countly.RecordEvent("Some event3", 4234, 1236.12, 234.5, null);

            Assert.True(res);

            Segmentation segm = new Segmentation();

            segm.Add("oneKey", "SomeValue");
            segm.Add("anotherKey", "SomeOtherValue");

            res = await Countly.RecordEvent("Some event4", 123, 456, segm);

            res = await Countly.RecordEvent("Some event5", 123, 456, 42.54, segm);

            Assert.True(res);
        }
Пример #4
0
        public async Task StartCountly()
        {
            Debug.WriteLine("Initializing Countly");
            Countly.IsLoggingEnabled = true;
            await Countly.StartSession(serverURL, appKey, "1.234", Countly.DeviceIdMethod.multipleFields);

            Countly.RecordEvent("SomeKey");
            Thread.Sleep(2000);
        }
Пример #5
0
        private async void OnResuming(object sender, object e)
        {
            Debug.WriteLine("Calling [OnResuming]");
            await Countly.Instance.SessionBegin();

            await Countly.RecordEvent("qwedqwe");

            await Countly.Instance.RecordView("Some View");
        }
Пример #6
0
        private void RecordEventSegmentation_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            Segmentation segmentation = new Segmentation();

            segmentation.Add("country", "Ukraine");
            segmentation.Add("app_version", "1.2");

            Countly.RecordEvent("seconds", DateTime.Now.Second, segmentation);
        }
Пример #7
0
 private void RecordBasicEvent_1000_Click(object sender, System.Windows.RoutedEventArgs e)
 {
     System.Diagnostics.Debug.WriteLine("Creating 1000 basic events");
     for (int a = 0; a < 1000; a++)
     {
         Countly.AddBreadCrumb("Basic event x1000");
         Countly.RecordEvent("seconds", DateTime.Now.Second + 1);
     }
 }
Пример #8
0
        private void RecordEventSegmentation_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
        {
            Segmentation segmentation = new Segmentation();

            segmentation.Add("country", "Ukraine");
            segmentation.Add("app_version", "1.2");

            Countly.RecordEvent("seconds", DateTime.Now.Second + 1, segmentation);

            Countly.AddBreadCrumb("segmentation event");
        }
Пример #9
0
 private void Fire_Event_Button_Click(object sender, RoutedEventArgs e)
 {
     if (EventTextBox.Text == "Enter test event name." || EventTextBox.Text == "")
     {
         MessageBox.Show("Please enter an event name for testing.");
     }
     else
     {
         Countly.RecordEvent(EventTextBox.Text);
     }
 }
Пример #10
0
        public static void RecordTestEvent(string clientType)
        {
            Initialize();

            if (LocalContext.GetTelemetrySettings() == false)
            {
                return;
            }

            var segmentation = GetSegmentation(clientType);
            var test         = Countly.RecordEvent("test-event", 1, segmentation).Result;
        }
Пример #11
0
        public async Task RecordEvent()
        {
            Countly.UserDetails.Name = UserName;
            await Countly.StartSession(Server, ApiKey);

            var segmentation = new Segmentation();

            segmentation.Add("test", new Random().Next(10).ToString());
            Countly.RecordEvent("unit-test", 1, 0, 123.5, segmentation);

            await Countly.EndSession();
        }
        void ThreadWorkEvents()
        {
            String[] eventKeys = new string[] { "key_1", "key_2", "key_3", "key_4", "key_5", "key_6" };
            Random   rnd       = new Random(0);

            for (int a = 0; a < threadIterations; a++)
            {
                int choice = a % 6;

                switch (choice)
                {
                case 0:
                    Countly.RecordEvent(eventKeys[0]);
                    break;

                case 1:
                    Countly.RecordEvent(eventKeys[1], 3);
                    break;

                case 2:
                    Countly.RecordEvent(eventKeys[2], 3, 4);
                    break;

                case 3:
                    Segmentation segm = new Segmentation();
                    segm.Add("foo", "bar");
                    segm.Add("anti", "dote");
                    Countly.RecordEvent(eventKeys[3], 3, segm);
                    break;

                case 4:
                    Segmentation segm2 = new Segmentation();
                    segm2.Add("what", "is");
                    segm2.Add("world", "ending");
                    Countly.RecordEvent(eventKeys[4], 3, 4.3, segm2);
                    break;

                default:
                case 5:
                    Segmentation segm3 = new Segmentation();
                    segm3.Add("what3", "is");
                    segm3.Add("world2", "ending");
                    Countly.RecordEvent(eventKeys[4], 3, 4.3, 6.7, segm3);
                    break;
                }

                Thread.Sleep(rnd.Next(threadWaitStart, threadWaitEnd));
            }
        }
        public async void VeryLargeEventName()
        {
            bool res;
            int  steps = 10;

            String[] str = TestHelper.CreateLargeStrings(steps, 1000);

            for (int a = 0; a < steps; a++)
            {
                String pre = "" + (a + 1) + "/" + steps + " | ";
                res = await Countly.RecordEvent(pre + str[a]);

                Thread.Sleep(5);
                Assert.True(res);
            }
        }
Пример #14
0
        public async Task SendAction()
        {
            Countly.UserDetails.Name = UserName;
            await Countly.StartSession(Server, ApiKey);

            Countly.RecordView("ScreenA", MakeSegment());

            var segmentation = MakeSegment();

            segmentation.Add("type", "click");
            segmentation.Add("x", "0");
            segmentation.Add("y", "0");
            segmentation.Add("width", "0");
            segmentation.Add("height", "0");
            Countly.RecordEvent("[CLY]_action", segmentation: segmentation);

            await Countly.EndSession();
        }
Пример #15
0
        public static void RecordStreamUpdated(string clientType)
        {
            Initialize();

            if (LocalContext.GetTelemetrySettings() == false)
            {
                return;
            }

            Task.Run(() =>
            {
                try
                {
                    Countly.RecordEvent("stream-updated", 1, GetSegmentation(clientType));
                }
                catch { }
            });
        }
Пример #16
0
        private async void Launched()
        {
            Debug.WriteLine("Calling [Launched]");
            //create the Countly init object
            Countly.IsLoggingEnabled = true;
            var cc = new CountlyConfig
            {
                serverUrl  = "SERVER_URL",
                appKey     = "APP_KEY",
                appVersion = "1.2.3",
            };

            //Countly.Instance.deferUpload = true;
            await Countly.Instance.Init(cc);

            await Countly.Instance.SessionBegin();

            await Countly.RecordEvent("qwedqwe");

            await Countly.Instance.RecordView("Some View");
        }
Пример #17
0
        private async void Launched()
        {
            Countly.IsLoggingEnabled = true;

            string ServerUrl = "SERVER_URL";
            string AppKey    = "API_KEY";

            if (ServerUrl == null)
            {
                throw new ArgumentNullException("Type your ServerUrl");
            }
            if (AppKey == null)
            {
                throw new ArgumentNullException("Type your AppKey");
            }

            await Countly.StartSession(ServerUrl, AppKey, "1.0", FileSystem.Current);

            Countly.RecordEvent("SDFDSFDSFSDF");
            Countly.RecordEvent("4345345345");
        }
Пример #18
0
        public async Task SendBunchOfEvents()
        {
            Countly.UserDetails.Name = UserName;
            await Countly.StartSession(Server, ApiKey);

            Countly.RecordEvent("ActionA", segmentation: MakeSegment());
            await Task.Delay(25);

            Countly.RecordEvent("ActionB", segmentation: MakeSegment());
            await Task.Delay(25);

            Countly.RecordEvent("ActionC", segmentation: MakeSegment());
            await Task.Delay(2100);

            Countly.RecordEvent("ActionD", segmentation: MakeSegment());
            await Task.Delay(25);

            Countly.RecordEvent("ActionE", segmentation: MakeSegment());
            await Task.Delay(1000);

            await Countly.EndSession();
        }
        public async void ChengeDeviceIDWithMerge()
        {
            bool res;

            res = await Countly.RecordEvent("Some event user1", 123);

            Assert.True(res);
            String dId = await Countly.Instance.DeviceData.GetDeviceId();

            Assert.NotNull(dId);
            Assert.NotEqual(0, dId.Length);

            String newId = "qweqwe";
            await Countly.Instance.ChangeDeviceId(newId, true);

            String dId2 = await Countly.Instance.DeviceData.GetDeviceId();

            Assert.Equal(newId, dId2);
            res = await Countly.RecordEvent("Some event same user", 123);

            Assert.True(res);
        }
Пример #20
0
        public async Task LongTestForSessions()
        {
            var random = new Random();

            Countly.UserDetails.Name = UserName;
            await Countly.StartSession(Server, ApiKey);

            for (int i = 0; i < 200; i++)
            {
                if (random.Next(2) == 0)
                {
                    Countly.RecordEvent("Action" + i, segmentation: MakeSegment());
                }
                else
                {
                    Countly.RecordView("Screen" + i, MakeSegment());
                }

                await Task.Delay(1000);
            }

            await Countly.EndSession();
        }
Пример #21
0
        private void RecordEventSum_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            Countly.RecordEvent("seconds", DateTime.Now.Second + 1, 0.99);

            Countly.AddBreadCrumb("sum event");
        }
Пример #22
0
        private void RecordBasicEvent_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            Countly.RecordEvent("seconds", DateTime.Now.Second + 1);

            Countly.AddBreadCrumb("basic event");
        }
Пример #23
0
 /// <summary>
 /// Event handler for when the user selects Quit from the logo button's menu
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Quit(object sender, RoutedEventArgs e)
 {
     Countly.RecordEvent("Quit");
     App.Shared.Shutdown();
 }
Пример #24
0
 private void About(object sender, RoutedEventArgs e)
 {
     Countly.RecordEvent("About");
     OpenAboutWindow();
 }
Пример #25
0
 private void Logout(object sender, RoutedEventArgs e)
 {
     Countly.RecordEvent("Logout");
     _ = Session.Signout();
 }
Пример #26
0
 private void ApplyMySettings(object sender, RoutedEventArgs e)
 {
     Countly.RecordEvent("Login");
     OpenLoginWindow();
 }
Пример #27
0
 private void TravelWithSettings(object sender, RoutedEventArgs e)
 {
     Countly.RecordEvent("Travel");
     OpenTravelWindow();
 }
Пример #28
0
 /// <summary>
 /// Event handler for when the user selects Customize Quick Strip from the main menu
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void CustomizeQuickStrip(object sender, RoutedEventArgs e)
 {
     Countly.RecordEvent("Customize MorphicBar");
 }
Пример #29
0
 /// <summary>
 /// Event handler for when the user selects Hide Quick Strip from the main menu
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void HideQuickStrip(object sender, RoutedEventArgs e)
 {
     Countly.RecordEvent("Hide MorphicBar");
     HideQuickStrip();
 }
Пример #30
0
 /// <summary>
 /// Event handler for when the user selects Show Quick Strip from the main menu
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void ShowQuickStrip(object sender, RoutedEventArgs e)
 {
     Countly.RecordEvent("Show MorphicBar");
     ShowQuickStrip();
 }