expo-beacon 0.6.9 → 0.6.10

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.
@@ -348,7 +348,12 @@ class BeaconForegroundService : Service(), BeaconConsumer {
348
348
  missCounters[region.uniqueId] = count
349
349
 
350
350
  if (enteredRegions.contains(region.uniqueId) && count >= EXIT_MISS_THRESHOLD) {
351
- cancelTimeout(region.uniqueId)
351
+ // Do NOT cancel the timeout here. A miss-based exit is triggered by BLE
352
+ // scan gaps (unreliable signal disappearance), not a confirmed physical
353
+ // departure. Cancelling the timeout here would prevent it from ever firing
354
+ // when the configured timeout (e.g. 25 s) exceeds the miss window (~21 s).
355
+ // The timeout runnable fires unconditionally; distance-based exits still
356
+ // call cancelTimeout() reliably when the beacon moves out of range.
352
357
  enteredRegions.remove(region.uniqueId)
353
358
  missCounters[region.uniqueId] = 0
354
359
  enterCounters[region.uniqueId] = 0
@@ -458,10 +463,11 @@ class BeaconForegroundService : Service(), BeaconConsumer {
458
463
  cancelTimeout(region.uniqueId)
459
464
  val runnable = Runnable {
460
465
  timeoutRunnables.remove(region.uniqueId)
461
- // Only fire if the beacon is still in range
462
- if (enteredRegions.contains(region.uniqueId)) {
463
- sendBeaconBroadcast(region, "timeout", -1.0)
464
- }
466
+ // Fire unconditionally. A miss-based exit may have cleared enteredRegions before
467
+ // the timer elapsed (BLE gaps can cause false exits at ~21 s), but the beacon
468
+ // may still be physically present. Distance-based exits call cancelTimeout() so
469
+ // this runnable is never queued when the beacon has genuinely moved away.
470
+ sendBeaconBroadcast(region, "timeout", -1.0)
465
471
  }
466
472
  timeoutRunnables[region.uniqueId] = runnable
467
473
  timeoutHandler.postDelayed(runnable, seconds * 1000L)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-beacon",
3
- "version": "0.6.9",
3
+ "version": "0.6.10",
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",