Estimote / react-native-proximity

React Native wrapper for Estimote Proximity SDK
Apache License 2.0
61 stars 38 forks source link

Debouncing Entry and Exit Events #19

Open gchallen opened 6 years ago

gchallen commented 6 years ago

I have a Google Pixel running Pie. Frequently I see it generate extremely quick sequences of entry and exit events—even when the phone is sitting 12 inches away from a beacon broadcasting quickly at high power and configured to detect within a 5 meter radius. Given that the goal of our app is to notify others when people arrive and leave, this is disconcerting behavior.

I've thought about ways to try and debounce this either on our device or on our server, but there are some complications, particularly on iOS where background operation is limited. (Although the problem seems less prevalent on iOS.) Plus, it's just kind of gross.

Is there a way for the native SDK to expose a parameter controlling how sticky locations are? This might help tune it to the peculiarities of different devices. (FWIW I've seen this with other beacons, so I suspect it's an issue with Android's Bluetooth stack on this device and not necessarily your beacons.)

heypiotr commented 6 years ago

Probably best discussed on the native SDKs' bug trackers and/or Estimote Forums, since these are changes that would need to be implemented on the native side. A "knob" for the "stickiness" sounds like a potentially good idea (:

A quicker fix for your app would be to be more liberal with the trigger radius. From my own experience, Androids especially vary drastically, and generally require higher numbers.

gchallen commented 6 years ago

OK good to know. What radius to you suggest for Android? I tried some higher numbers but then had the opposite problem (that you'd expect): not getting exit events promptly.

heypiotr commented 6 years ago

It's really tough to say, I'd actually expect that for the best results, the numbers would need to be tuned almost per device. There's been ideas/efforts to crowd-source this knowledge, but none that I know of have worked out. (e.g., see the model-distance-calculations.json in the open-source Android Beacon Library)