public BeaconService() { _connection = DependencyService.Resolve <SQLiteConnectionProvider>().GetConnection(); _connection.CreateTable <BeaconDataModel>(); _userDataService = DependencyService.Resolve <UserDataService>(); _userData = _userDataService.Get(); _httpDataService = DependencyService.Resolve <HttpDataService>(); _uploadTimer = new MinutesTimer(_userData.GetJumpHashTimeDifference()); _uploadTimer.Start(); _uploadTimer.TimeOutEvent += TimerUpload; _beaconTransmitter = new CBPeripheralManager(); _beaconTransmitter.AdvertisingStarted += DidAdvertisingStarted; _beaconTransmitter.StateUpdated += DidStateUpdated; _listOfCLBeaconRegion = new List <CLBeaconRegion>(); _fieldRegion = new CLBeaconRegion(new NSUuid(AppConstants.iBeaconAppUuid), ""); _fieldRegion.NotifyEntryStateOnDisplay = true; _fieldRegion.NotifyOnEntry = true; _fieldRegion.NotifyOnExit = true; // Monitoring _beaconManager = new CLLocationManager(); _beaconManager.DidDetermineState += DetermineStateForRegionComplete; _beaconManager.RegionEntered += EnterRegionComplete; _beaconManager.RegionLeft += ExitRegionComplete; _beaconManager.PausesLocationUpdatesAutomatically = false; _beaconManager.AllowsBackgroundLocationUpdates = true; _beaconManager.ShowsBackgroundLocationIndicator = true; _beaconManager.DidRangeBeacons += DidRangeBeconsInRegionComplete; _beaconManager.AuthorizationChanged += HandleAuthorizationChanged; }
public void StartRagingBeacons(UserDataModel userData) { _userData = userData; MainActivity.StartRagingBeacons(); _uploadTimer = new MinutesTimer(_userData.GetJumpHashTimeDifference()); _uploadTimer.Start(); _uploadTimer.TimeOutEvent += TimerUploadAsync; }
public BeaconService() { _mainActivity = MainActivity.Instance; _connection = MainActivity.sqliteConnectionProvider.GetConnection(); _connection.CreateTable <BeaconDataModel>(); _userDataService = DependencyService.Resolve <UserDataService>(); _userData = _userDataService.Get(); _httpDataService = DependencyService.Resolve <HttpDataService>(); _uploadTimer = new MinutesTimer(_userData.GetJumpHashTimeDifference()); _uploadTimer.Start(); _uploadTimer.TimeOutEvent += TimerUpload; }
public BeaconService() { _connection = DependencyService.Resolve <SQLiteConnectionProvider>().GetConnection(); _connection.CreateTable <BeaconDataModel>(); _userDataService = DependencyService.Resolve <UserDataService>(); _userData = _userDataService.Get(); _httpDataService = DependencyService.Resolve <HttpDataService>(); _uploadTimer = new MinutesTimer(_userData.GetJumpHashTimeDifference()); _uploadTimer.Start(); _uploadTimer.TimeOutEvent += TimerUpload; _beaconManager = new CLLocationManager(); _beaconTransmitter = new CBPeripheralManager(); _beaconTransmitter.AdvertisingStarted += DidAdvertisingStarted; _beaconTransmitter.StateUpdated += DidStateUpdated; _listOfCLBeaconRegion = new List <CLBeaconRegion>(); _fieldRegion = new CLBeaconRegion(new NSUuid(AppConstants.iBeaconAppUuid), ""); _fieldRegion.NotifyEntryStateOnDisplay = true; _fieldRegion.NotifyOnEntry = true; _fieldRegion.NotifyOnExit = true; }
private void StartTimer() { _downloadTimer = new MinutesTimer(current.GetJumpHashTimeDifference()); _downloadTimer.Start(); _downloadTimer.TimeOutEvent += TimerDownload; }