Пример #1
0
        public LocationService(LocationConfig config)
        {
            _Config = config;
            State   = LocationServiceState.None;

            _Manager = (LocationManager)config.AppContext.GetSystemService(Context.LocationService);
        }
Пример #2
0
 public void Configure(IMvxPluginConfiguration configuration)
 {
     if (!(configuration is LocationConfig))
     {
         throw new ArgumentException("Configuration is not a LocationConfig");
     }
     _Config = (LocationConfig)configuration;
 }
Пример #3
0
 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;
     }
 }