react-native-nitro-geolocation 1.2.2 → 1.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -148,9 +148,15 @@ class NitroGeolocation: HybridNitroGeolocationSpec {
148
148
  private struct ParsedHeadingOptions {
149
149
  let headingFilter: CLLocationDegrees
150
150
 
151
+ // Apple's documented `CLLocationManager.headingFilter` default is 1°.
152
+ // Defaulting to `0` here propagates through `mergeHeadingFilter` into
153
+ // `kCLHeadingFilterNone` (-1), which fires the delegate on every
154
+ // CLHeading tick (sub-degree firehose for stationary users). 1° matches
155
+ // CL's documented behavior and lets the delegate fire only on
156
+ // perceptible changes.
151
157
  static func parse(from options: HeadingOptions?) -> ParsedHeadingOptions {
152
158
  return ParsedHeadingOptions(
153
- headingFilter: options?.headingFilter ?? 0
159
+ headingFilter: options?.headingFilter ?? 1
154
160
  )
155
161
  }
156
162
  }
@@ -947,7 +953,7 @@ class NitroGeolocation: HybridNitroGeolocationSpec {
947
953
  }
948
954
 
949
955
  private func angularDistance(_ first: Double, _ second: Double) -> Double {
950
- let distance = abs(first - second).truncatingRemainder(dividingBy: 360)
956
+ let distance = Swift.abs(first - second).truncatingRemainder(dividingBy: 360)
951
957
  return distance > 180 ? 360 - distance : distance
952
958
  }
953
959
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-nitro-geolocation",
3
- "version": "1.2.2",
3
+ "version": "1.2.4",
4
4
  "description": "Nitro-powered native geolocation for modern React Native apps",
5
5
  "main": "src/index",
6
6
  "source": "src/index",