Hi, I am trying to create an App which connects to a Device via Wifi and then has to do some HTTP Requests. Connecting to the Wifi is working properly but when I try to make an HTTP API Call I get the response that the Domain is unavailable (No Internet Connection). I created the App in Flutter on Android everything works perfectly. The packages are all iOS Compatible. But in Safari the URL works so it is probably a permission Issue. I have the Following permissions granted:
NSAppTransportSecurity <NSAllowsArbitraryLoads> NSBonjourServices NSLocalNetworkUsageDescription I even have Multicast Networking
When I test the App I get asked to grant the access to local Network which I am granting.
I don´t know what I should do next can somebody help? Feel free to ask for more Information
Before I start, I want to be clear that I can’t help you with third-party tooling. If you need help translating my response to your third-party setup, I recommend that you seek assistance from that third-party’s support channel.
On the Apple side of things, there are three common causes of the problems like this:
- App Transport Security
- Local network privacy
- Interface lifecycle
For the first, I recommend that you temporarily use NSAllowsArbitraryLoads
to disable ATS completely. Once you get things working reliably, you can go revisit that choice. Setting up secure communication with an accessory is tricky; see TLS For Accessory Developers for my advice on that front.
For the second, see TN3179 Understanding local network privacy.
For third, this is something I discuss in detail in various posts hanging off Extra-ordinary Networking. Specifically, Working with a Wi-Fi Accessory defines three categories of Wi-Fi based accessory, and it’s important to understand this category before you go further
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"