Distance_Type_Earshot Runtime Error, Nearby Messages API

149 Views Asked by At

How do I resolve a Runtime error by Distance_Type_Earshot? I'm trying to build Nearby Messages API (just the audio/earshot) into my Android application, I've even built another demo app to test it out again, but same issue.

Basically, everything is set up okay, when using Distance_Type_Default, it works just fine too, but for some reason whenever it's set to Distance_Type_Earshot it just doesn't work. The funny thing is there are no exceptions or errors, it's just that the phones I'm testing with just can't seem to detect each other? I'm trying to use audio/microphone exclusively, as my app can't use BLE/Bluetooth.

I've tried changing Discovery to Broadcast and Scan and Default, it doesn't seem to make a difference but the issue still stands.

1

There are 1 best solutions below

1
On

The API stopped working for me with the latest Google Play Services release April 1, 2021.

I have asked for clarification specifically on the Earshot/ultrasonics only setting as my app had been working for over a year. See https://issuetracker.google.com/issues/184423907 I may have filed the issue in the wrong place, also why I am here :-p

For the discovery, at least one device needs to broadcast the "anonymous token" code to one or more devices that are listening (scan).

If everyone is broadcasting and scanning, then the protocol needs a bit more time to chose a leader. If there is a single broadcaster and multiple scanners - there is no need to spend time to negotiate who is in charge. (Faster)