diff options
Diffstat (limited to 'Juick/ViewModels')
-rw-r--r-- | Juick/ViewModels/AppViewModel.cs | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/Juick/ViewModels/AppViewModel.cs b/Juick/ViewModels/AppViewModel.cs index e3a58bb..2aff819 100644 --- a/Juick/ViewModels/AppViewModel.cs +++ b/Juick/ViewModels/AppViewModel.cs @@ -38,13 +38,8 @@ namespace Juick.ViewModels pushChannel = new HttpNotificationChannel(channelName); // Register for all the events before attempting to open the channel. - pushChannel.ChannelUriUpdated += (sender, e) => { - EnableNotifications(); - }; - pushChannel.ErrorOccurred += (sender, e) => - { - DisableNotifications(); - }; + pushChannel.ChannelUriUpdated += (sender, e) => EnableNotifications(); + pushChannel.ErrorOccurred += (sender, e) => DisableNotifications(); // Register for this notification only if you need to receive the notifications while your application is running. // Register for this notification only if you need to receive the notifications while your application is running. @@ -76,10 +71,7 @@ namespace Juick.ViewModels else { // The channel was already open, so just register for all the events. - pushChannel.ChannelUriUpdated += (sender, e) => - { - EnableNotifications(); - }; + pushChannel.ChannelUriUpdated += (sender, e) => EnableNotifications(); pushChannel.ErrorOccurred += (sender, e) => DisableNotifications(); // Register for this notification only if you need to receive the notifications while your application is running. @@ -149,11 +141,14 @@ namespace Juick.ViewModels } private RestClient _cl; + + private readonly string _juickUri = HttpsHelper.CanUseHttps ? "https://api.juick.com" : "http://api.juick.com"; + public RestClient Client { get { - return _cl ?? (_cl = new RestClient("http://api.juick.com") + return _cl ?? (_cl = new RestClient(_juickUri) { UserAgent = "Juick 1.1/Windows Phone " + Environment.OSVersion.Version }); |