I am using Unity and I developed a App that just has a button. By clicking it, it will send a message via MQTT to my Windows-PC. I installed on my Windows-PC mosquitto and I set up the broker and everything. So after I click the button in unity, it sends succesful a message via MQTT to my broker on my localhost (Windows-PC). And then there is a NodeMCU with the ESP8266 which is also connected to the broker and subscribed to the correct topic. The NodeMCU then turns an LED on if he reads the message.
So far everything works perfect when testing everything on my Windows-PC in unity. But after I build the app on unity and installed the app on my iPhone it doesnt work anymore. It doesnt connect to the MQTT Broker anymore etc.
I used for MQTT this library: https://github.com/gpvigano/M2MqttUnity
Can someone please help me and explain me how to do it? I just simply want to click a button on my App and then my NodeMCU should recognize it and should turn the LED on. What did I do wrong?