How can I make my ESP8266 Discoverable for a mobile app via TCP/IP?

ello everyone!

For months I started building my own product which is using an ESP8266 (NodeMCU). I'm using the WifiManager library which creates an AP so the mobile phone can find it and connect with it through a portal where the user will select their WiFi and put the credentials. Everything is fine in that department.
Also the device connects against an MQTT Server (Aedes) and against an API for authentication. That's also working fine, no problems so far.

The challenge that I have now is the following:

I want to develop a mobile app (nowadays I just created a node view app for testing), and I would like to imitate the function of others mobiles apps for IoT projects, where you can search for your smart devices connected to the network and associate them with a user account. I don't want to do it by using bluetooth, I know there is another way to do it by using TCP/IP or UDP but I don't know how to do it, or better say, I don't know which are the steps to accomplish it.

I thought about assigning a hostname to the device by using WiFi.hostname("xx") and open a port where it serves an XMLs with its information, so the mobile app can find it and recognize it, but I'm not sure if this is the correct approach to do it neither how to do it correctly. Like: How can I scan the network by knowing only a part of the hostname? i.e: Hostname: "ESP-XX-AA11". I only will know ESP-XX.

So doubts I have are:

  1. Should I run a port/host scanner on Mobile (for testing, in js for my node webapp)? Do you know any of those?
  2. Should I create a fingerprint on my esp8266 device or something like that?
  3. Is there any other known way to discover devices?

Thank you in advance

the keyword is UPNP

Would you mind helping me on understanding how should I implement uPNP? There are tons of libraries, I tried two already but they seems to be custom that could not work with some routers.
I have tried this one TinyUPnP with no luck.

Thanks

kasperuza:
Would you mind helping me on understanding how should I implement uPNP? There are tons of libraries, I tried two already but they seems to be custom that could not work with some routers.
I have tried this one TinyUPnP with no luck.

Thanks

sorry, I have no coding experience with UPNP

Well, I would like to leave this post open till someone with experience on this kind of solutions can enlighten me a little but more.
Thanks!