spotny-sdk 1.0.13 → 1.0.14
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.
|
@@ -782,8 +782,9 @@ extension SpotnyBeaconScanner: KTKBeaconManagerDelegate {
|
|
|
782
782
|
// Build the JS event payload for ALL ranged beacons
|
|
783
783
|
let beaconPayload: [[String: Any]] = beacons.compactMap { beacon in
|
|
784
784
|
let raw = beacon.accuracy
|
|
785
|
+
guard raw > 0 else { return nil }
|
|
785
786
|
let adjusted = raw * distanceCorrectionFactor
|
|
786
|
-
guard adjusted
|
|
787
|
+
guard adjusted <= maxDetectionDistance else { return nil }
|
|
787
788
|
return [
|
|
788
789
|
"uuid": beacon.proximityUUID.uuidString,
|
|
789
790
|
"major": beacon.major.intValue,
|
|
@@ -817,9 +818,10 @@ extension SpotnyBeaconScanner: KTKBeaconManagerDelegate {
|
|
|
817
818
|
let minor = beacon.minor.intValue
|
|
818
819
|
let key = beaconKey(major: major, minor: minor)
|
|
819
820
|
let raw = beacon.accuracy
|
|
821
|
+
guard raw > 0 else { continue }
|
|
820
822
|
let distance = raw * distanceCorrectionFactor
|
|
821
823
|
|
|
822
|
-
guard distance
|
|
824
|
+
guard distance <= maxDetectionDistance else { continue }
|
|
823
825
|
|
|
824
826
|
// FIX #9: nil lastDist already implies first detection — no separate isFirst needed
|
|
825
827
|
let lastDist = lastProximityDistance[key]
|