Skip to content

Commit

Permalink
add beacon scan stop function
Browse files Browse the repository at this point in the history
  • Loading branch information
jeongHunE committed Apr 2, 2024
1 parent ad734ae commit 0346089
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion BeaconSync.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'BeaconSync'
s.version = '0.1.1'
s.version = '0.1.2'
s.summary = 'A short description of BeaconSync.'

# This description is used to generate tags and improve search results.
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions SourceCode/BeaconManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ class BeaconManager: NSObject, CLLocationManagerDelegate {
locationManager.stopUpdatingLocation()
}

//MARK: - Stop Beacon scanning
func stopUpdateLocation() {
self.locationManager.stopUpdatingLocation()
}

//MARK: - Tells the delegate when the app creates the location manager and when the authorization status changes
func locationManagerDidChangeAuthorization(_ manager: CLLocationManager) {
if manager.authorizationStatus == .authorizedAlways || manager.authorizationStatus == .authorizedWhenInUse {
Expand Down
4 changes: 4 additions & 0 deletions SourceCode/BeaconSync.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ public struct BeaconSync {
.store(in: &cancellables)
}

public func stopSync() {
beaconManager.stopUpdateLocation()
}

public func publishBeacons() -> AnyPublisher<[CLBeacon]?, Never> {
return beaconManager.$beacons
.eraseToAnyPublisher()
Expand Down

0 comments on commit 0346089

Please sign in to comment.