I'm using the new Nearby APIs : https://developers.google.com/nearby/ to send a message a short distance between devices (~5 feet). I have set the Strategy distance type to DISTANCE_TYPE_EARSHOT, but I still receive messages at long distances between devices. Is there anyway I can restrict the proximity further to get a message when devices are truly only within earshot?
Asked
Active
Viewed 1,628 times
3
-
I have the exact same problem, I don't think that it's actually working. @passsy what problem? – Loolooii Sep 06 '15 at 18:54
-
@passsy Sorry, I read "see" problem here. I guess I need some rest! – Loolooii Sep 06 '15 at 18:59
1 Answers
5
I can answer my own question here. I spoke with the developer of this API, and he told me that after the initial link is made between devices, they will stay connected for 10 minutes regardless of distance. That is what leads to the unexpected behavior noted above.

hellowill89
- 1,538
- 2
- 15
- 26
-
So that means that the distance for making a connection is restricted, but once they are connected it does not matter what the distance is? Last time I tested my devices also connected with a distance of around 10 meters. Still it sounds a bit vague. – Loolooii Sep 07 '15 at 12:49
-
If you use EARSHOT, it ends up being around 5-10ft. But once the devices connect, then all subsequent connections will by happen regardless of range for the next 10 minutes. – hellowill89 Sep 08 '15 at 18:16
-
3Just to follow-up (I'm _a_ developer of this API) ... we're not guaranteeing this 10-minute link as part of the API contract, but it is how things work today. – Andrew Bunner Nov 14 '15 at 00:15
-
1@AndrewBunner On Android, I am able to set the distance type to ear shot. I am not able to find an equivalent API for iOS. Is there a way to limit it to ~5ft on iOS as well? – Arun Anjay Anantha Apr 15 '16 at 21:08
-
@ArunAnjayAnantha, check https://cocoapods.org/pods/NearbyMessages ... the part where you set params.strategy. "params.discoveryMediums = kGNSDiscoveryMediumsAudio" will do it – Andrew Bunner Jul 27 '16 at 18:57
-
On iOS, we don't explicitly support the earshot concept, but we may add it because of the confusion it's causing between the two platforms. As Andrew pointed out, you can can restrict your pub/sub to use the audio medium in your GNSStrategy object. – Dan Webb Jul 27 '16 at 19:05