Well. Can you even access that ip/domain that you’re trying to access from your phone? And do you have cordova-plugin-whitelist ? Some people solved their problem by removing and adding it.
Hi, yes I have whitelist installed. I have removed/installed it also. I can access the server using the IP but the whole point of the server is to be accessed using .LOCAL domain which then returns the IP of the server which is in the future used for communication. Is there any way that I can access .local domain?
Thanks for your answer.
Hi, Thanks for the answer. No I don’t have any proxies. The issue is that the domain is .local and that is not being resolved. I am now trying with the Zeroconf plugin, I will see what happens. I haven’t used this plugin before.
Hi, I am trying with the native HTTP plugin and the error now says, The host could not be resolved. I am looking for a solution online, but if you have any idea , it will be great. I will try the backend library also.
I feel dumb after just noticing that of course it won’t work if you’re running the service locally. If it’s running in your localhost of course it’ll work in the browser if you try it on the same machine. But the smartphone is a DIFFERENT machine and it’s not running any service locally, in short words: nothing running in your computer locally will work if you put the “localhost/service…” on the request.
What you have to do is to be on the same network and use the IPv4 of your machine, that’d look something like 192.168.1.10 you can find it if you run ipconfig on Windows’ CMD or ifconfig in Linux terminal
Hi, I know that. Everything works fine with the IP. But the whole point doing this is that I should not find the ip from ipconfig. I have a mDNS server running which replies me the ip whenever i access something.local. This is the same which i need to do in the app. The app will then get the IP and the rest of the communication will work using the IP which is working fine in the same app too.
In the server I have not specified the type of the request. So in postman both get and post requests works. In the APP I have tried with both also, i get the same error. The problem is that android is trying to access the DNS servers to resolve the link but of course it wont be resolved.
I know about the cors issue, I have the Allow origin with *. Before that the connection with the IP was also not working.
@NIOS no I haven’t and i dont want to. That will kill the point of mDNS server, which is used only to get the IP. I am setting up the WiFi using Smartconfig plugin. So the user just needs to click one button which doess all the things.
One thing is for sure, the App isn’t finding the host, which I feel it means your DNS might not be working for this case. You could try as I said before about the ipconfig. If with that works, at least you have reduced the problem
Well. I guess you could add your own dns on the Android network settings? Otherwise i dont know how it would know about your dns server and be able to use it for resolving your .local