I have a Xamarin application that requires to connect to a device from the LAN side and also the WAN side. The device (an ESP8266) is connected via WiFi to an internal network and can be accessed from the WAN side via DDNS.
When the user makes a request (via the Xamarin app), whilst using mobile data (i.e. they are not connected to the WiFi network), the request reaches the IoT device (the IoT device makes a UPNP mapping on the router).
The IoT device uses mDNS to make itself known on the local network, and if I try to connect via Chrome on Windows 10 on a machine connected to the same network, the connection is successful (using 'domain.local'). Doing the same on on Chrome on Android gets a DNS error.
If the user now connects the phone to the same network as the IoT device, the Xamarin app request will no longer reach the IoT device. I have some code which distinguishes between a local request and a remote request which makes either a 'domain.local' request or a 'domain.ddns.net' request.
I understand the Apple Bonjour aspect of this on my desktop machine and the lack thereof on the Android platform.
Does anyone know how to resolve this?