Skip to content

Commit

Permalink
#30 register location listener without UI startup
Browse files Browse the repository at this point in the history
  • Loading branch information
robo-w committed Feb 27, 2019
1 parent f79df08 commit 76e67a6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
5 changes: 0 additions & 5 deletions GeoClient/GeoClient/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
using System;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
using Microsoft.AppCenter;
using Microsoft.AppCenter.Analytics;
using Microsoft.AppCenter.Crashes;

[assembly: XamlCompilation(XamlCompilationOptions.Compile)]

Expand All @@ -19,8 +16,6 @@ public App()
{
InitializeComponent();
MainPage = new MainPage();

LocationChangeRegistry.Instance.RegisterListener(RestService.Instance);
}

protected override void OnStart()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Concurrent;
using GeoClient.Services.Boundary;
using Xamarin.Forms.Internals;

namespace GeoClient.Services.Location
Expand All @@ -17,6 +18,7 @@ static LocationChangeRegistry()
private LocationChangeRegistry()
{
_locationListeners = new ConcurrentDictionary<ILocationUpdateListener, byte>();
RegisterListener(RestService.Instance);
}

public static LocationChangeRegistry Instance { get; } = new LocationChangeRegistry();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public void UnregisterListener(IGeoRegistrationListener listener)

public bool IsRegistered()
{
TryToLoadRegistrationInfo();
return _cachedRegistrationInfo != null;
}

Expand Down

0 comments on commit 76e67a6

Please sign in to comment.