public LocationService(LocationConfig config) { _Config = config; State = LocationServiceState.None; _Manager = (LocationManager)config.AppContext.GetSystemService(Context.LocationService); }
public void Configure(IMvxPluginConfiguration configuration) { if (!(configuration is LocationConfig)) { throw new ArgumentException("Configuration is not a LocationConfig"); } _Config = (LocationConfig)configuration; }
public LocationPlayService(LocationConfig config) { _Config = config; // check if play services is enabled if (_Config.CheckEnabled == null) { throw new Exception("Unable to check whether play services are available. Make sure you have a CheckEnabled Action."); } State = (_Config.CheckEnabled()) ? LocationServiceState.Enabled : LocationServiceState.Disabled; _Client = LocationServices.GetFusedLocationProviderClient(config.AppContext); if (_Client == null) { State = LocationServiceState.Disabled; } }