expo-beacon 0.6.10 → 0.6.11

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.
@@ -1078,7 +1078,7 @@ public class ExpoBeaconModule: Module {
1078
1078
  eddystoneEnterCounters[identifier] = 0
1079
1079
  eddystoneExitCounters[identifier] = 0
1080
1080
  eddystoneLatestSeen.removeValue(forKey: identifier)
1081
- cancelEddystoneTimeout(identifier: identifier)
1081
+ // Do NOT cancel the timeout here — same reason as iBeacon miss-based exit.
1082
1082
 
1083
1083
  let ns = paired["namespace"] as? String ?? ""
1084
1084
  let inst = paired["instance"] as? String ?? ""
@@ -1108,8 +1108,10 @@ public class ExpoBeaconModule: Module {
1108
1108
  let work = DispatchWorkItem { [weak self] in
1109
1109
  guard let self = self else { return }
1110
1110
  self.beaconTimeoutTimers.removeValue(forKey: identifier)
1111
- // Only fire if the beacon is still in range
1112
- guard self.enteredRegions.contains(identifier) else { return }
1111
+ // Fire unconditionally. A miss-based exit may have cleared enteredRegions before
1112
+ // the timer elapsed (ranging gaps can cause false exits), but the beacon may still
1113
+ // be physically present. Distance-based exits call cancelBeaconTimeout() so this
1114
+ // work item is cancelled before it runs on genuine out-of-range departures.
1113
1115
  self.sendLoggedEvent("onBeaconTimeout", self.makeBeaconEventParams(identifier: identifier, beacon: beacon))
1114
1116
  }
1115
1117
  beaconTimeoutTimers[identifier] = work
@@ -1130,7 +1132,7 @@ public class ExpoBeaconModule: Module {
1130
1132
  let work = DispatchWorkItem { [weak self] in
1131
1133
  guard let self = self else { return }
1132
1134
  self.eddystoneTimeoutTimers.removeValue(forKey: identifier)
1133
- guard self.eddystoneEnteredRegions.contains(identifier) else { return }
1135
+ // Fire unconditionally same reason as iBeacon timeout.
1134
1136
  self.sendLoggedEvent("onEddystoneTimeout", [
1135
1137
  "identifier": identifier,
1136
1138
  "namespace": namespace,
@@ -1377,7 +1379,11 @@ public class ExpoBeaconModule: Module {
1377
1379
  missCounters[identifier] = 0
1378
1380
  enterCounters[identifier] = 0
1379
1381
  exitCounters[identifier] = 0
1380
- cancelBeaconTimeout(identifier: identifier)
1382
+ // Do NOT cancel the timeout here. A miss-based exit is triggered by
1383
+ // ranging gaps (e.g. accuracy == -1), not a confirmed physical departure.
1384
+ // Cancelling here prevents the timeout from firing when it is longer than
1385
+ // the miss window. Distance-based exits call cancelBeaconTimeout() so the
1386
+ // timer is still cancelled on genuine out-of-range events.
1381
1387
 
1382
1388
  // Look up region info for the exit event payload
1383
1389
  let region = monitoredRegions.first { $0.identifier == identifier }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-beacon",
3
- "version": "0.6.10",
3
+ "version": "0.6.11",
4
4
  "description": "Expo module for scanning, pairing, and monitoring iBeacons on Android and iOS",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",