Skip to content

Commit 6eba0ea

Browse files
authored
fix(ios): read enableHighAccuracy geolocation option (#1773)
1 parent 7a0aae6 commit 6eba0ea

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ios/Capacitor/Capacitor/Plugins/Geolocation.swift

+5-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ class GetLocationHandler: NSObject, CLLocationManagerDelegate {
2323
// TODO: Allow user to configure accuracy, request/authorization mode
2424
self.locationManager.delegate = self
2525
self.locationManager.requestWhenInUseAuthorization()
26-
self.locationManager.desiredAccuracy = kCLLocationAccuracyBest
26+
if call.getBool("enableHighAccuracy", false)! {
27+
self.locationManager.desiredAccuracy = kCLLocationAccuracyBestForNavigation
28+
} else {
29+
self.locationManager.desiredAccuracy = kCLLocationAccuracyBest
30+
}
2731

2832
if let shouldWatch = options["watch"], shouldWatch as? Bool == true {
2933
self.locationManager.startUpdatingLocation()

0 commit comments

Comments
 (0)