So I am working with trying to transfer data between two phones with Google Nearby Connections.
For example, say I want to transfer a variable from each phone to another and then show a toast containing the text from the other phone.
I have been looking into the Connections API but I can't seem to limit it to when two phones are really close to each other. I have seen that the Nearby Messages API has an Earshot distance option.
But there isn't an option for earshot distance in the Nearby Connections API since the Nearby messages API doesn't seem to contain what I need to make something like the example above work.
Hope you can help me :)
There hadn't been a feature request for it until now, which is why there's no support in Nearby Connections.
I believe Nearby Messages would support your use case, though. It can exchange a few KB of data to other devices nearby. It's not a live bi-directional channel, like Nearby Connections is, but it doesn't sound like you need that.