Search code examples
androidgoogle-nearby

Nearby Connection 2.0: Identify endpoint over reconnection


Is there a way to uniquely identify a discovered endpoint and persist that information over reconnection? Apparently the endpointId changes after a disconnection. If I correctly recall, in the former api there was a persistent identifier.


Solution

  • Nearby Connections doesn't support reconnections yet, but you can encode a persistent id in your endpoint name (eg. endpointName="1234:Will").

    Please note that the endpoint name can be spoofed, so if you need a secure connection you need to either compare the auth token or do some more authentication after accepting the connection.