Search code examples
c#windows-runtimeproximityapi

PeerFinder DiscoveryData length is preventing the client from being seen


I have a UWP app written in C# that is using the Proximity API. I am successfully launching the clients and able to detect them in the host app as long as the DiscoveryData is 25 bytes or less. When I set the DiscoveryData with anywhere from 26-32 bytes (there is a 32 byte limit), PeerFinder.FindAllPeersAsync() does not detect the client.

Has anyone encountered this?


Solution

  • I found the issue. I was setting my DisplayName to a 32 character string (even though it has a 50 character limit) which seems to be counting against some unknown byte limit in PeerInformation. When I set my DisplayName to a shorter string, it will accept the 32 byte DiscoveryData and be visible to the host.