diff --git a/windows/Countly/Countly.cs b/windows/Countly/Countly.cs index d7de722d..70497076 100644 --- a/windows/Countly/Countly.cs +++ b/windows/Countly/Countly.cs @@ -75,6 +75,9 @@ public static class Countly // Exceptions queue private static List Exceptions { get; set; } + // Raised when the async session is established + public static event EventHandler SessionStarted; + // User details info public static CountlyUserDetails UserDetails { get; set; } @@ -176,7 +179,12 @@ public static async Task StartSession(string serverUrl, string appKey, Applicati Timer.Tick += UpdateSession; Timer.Start(); - AddSessionEvent(new BeginSession(AppKey, Device.DeviceId, sdkVersion, new Metrics(Device.OS, Device.OSVersion, Device.DeviceName, Device.Resolution, Device.Carrier, Device.AppVersion))); + await AddSessionEvent(new BeginSession(AppKey, Device.DeviceId, sdkVersion, new Metrics(Device.OS, Device.OSVersion, Device.DeviceName, Device.Resolution, Device.Carrier, Device.AppVersion))); + + if (null != SessionStarted) + { + SessionStarted(null, EventArgs.Empty); + } } /// diff --git a/windows/CountlySample/App.xaml.cs b/windows/CountlySample/App.xaml.cs index dff2288f..7be2b750 100644 --- a/windows/CountlySample/App.xaml.cs +++ b/windows/CountlySample/App.xaml.cs @@ -142,7 +142,7 @@ private void Activated() Countly.IsLoggingEnabled = true; Countly.IsExceptionsLoggingEnabled = true; - string ServerUrl = "http://cloud.count.ly"; + string ServerUrl = "http://try.count.ly"; string AppKey = null; if (ServerUrl == null) diff --git a/windows/CountlySample/MainPage.xaml.cs b/windows/CountlySample/MainPage.xaml.cs index f9b8a22c..b2099e59 100644 --- a/windows/CountlySample/MainPage.xaml.cs +++ b/windows/CountlySample/MainPage.xaml.cs @@ -55,7 +55,8 @@ public MainPage() { initialized = true; - UserNameText.Text = Countly.UserDetails.Name ?? String.Empty; + Countly.SessionStarted += async (sender, args) => + UserNameText.Text = Countly.UserDetails.Name ?? String.Empty; }; } @@ -88,7 +89,7 @@ private async void TrackingCheck_Checked(object sender, Windows.UI.Xaml.RoutedEv { if (initialized) { - string ServerUrl = "http://cloud.count.ly"; + string ServerUrl = "http://try.count.ly"; string AppKey = null; if (ServerUrl == null)