0

Working with Windows 10 Universal app.

Trying to utilise Proximity API. Using 2 Dell tablets with wifi connections. There is a couple of good examples demonstrating data transfer using Wifi Direct + Proximity API and devices running the same app. My problem is that I have the two different apps (with different Package Family Names). I've tried using PeerFinder.AlternateIdentities.Add() method without success. My code looks like this:

public async Task FindPeersAsync()
{
    PeerInformationList = null;

    if ((PeerFinder.SupportedDiscoveryTypes & PeerDiscoveryTypes.Browse) == PeerDiscoveryTypes.Browse)
    {
        if (PeerFinder.AllowWiFiDirect)
        {
            PeerFinder.AlternateIdentities.Add("Server", "app1PackageFamilyName!App");
            PeerFinder.AlternateIdentities.Add("Client", "app2PackageFamilyName!App");}");

            PeerInformationList = await PeerFinder.FindAllPeersAsync();

            DisplayStatusMessage(PeerInformationList == null
                 ? "Found no peer"
                 : $"I found {PeerInformationList.Count()} devices(s) executing this same app!");
        }
        else
        {
            DisplayStatusMessage("WIFI direct not available");
        }
    }
    else
    {
        DisplayStatusMessage("Browse not available");
    }
}

My PeerFinder.Role is set to PeerRole.Peer(by default).

Example code is taken from here: https://msdn.microsoft.com/en-us/library/windows/apps/windows.networking.proximity.peerfinder.alternateidentities.aspx

Edit: If I use the same app on both tablets I can see the other device but this is not possible if I'm running different apps on the 2 devices.

My question is - is using Wifi Direct filetransfer possible between different apps (both of them windows 10 universal) and if yes what am I missing?

Thanks in advance.

Milen
  • 8,697
  • 7
  • 43
  • 57
  • According to the docs, each app must be have an alternate identity of the other; so both have two identities. Is this the case? – x0n Aug 03 '15 at 18:14
  • Yes @x0n each app has its own identity `app1PackageFamilyName!App` and `app2PackageFamilyName!App` in my sample code. – Milen Aug 03 '15 at 18:27
  • Not quite sure about `client` and `server` - according to the docs it should be windows and windows phone if targeting different platforms but what about universal app with windows 10 now? – Milen Aug 03 '15 at 18:32

0 Answers0