I want to connect my iOS App with a MQTT Server via a Kotlin Multiplatform XCFramework.
This Framework uses the library KMQTT to connect to our MQTT Server. As you can see Here KMQTT uses the default POSIX commands to connect to a socket. This setup works great on Android, not so much for iOS:
- When connecting to a IPv6 Address iOS devices get the POSIX Error 47, this was "fixed" by only using IPv4
- more importantly: On ~50% of devices, when connecting to the socket they get the POSIX Error 1 (EPERM). The devices are iPhone 13, 14 Pro and a 15 and they all use either iOS 17 or iOS 18. When trying to open the ip via Safari they can connect. This problem seems to come from the Provider, as when i open a Hotspot from a device that doesn't work, all connected iOS Devices also don't work and when another device that works opens a hotspot and the not-working device connects to it, this device works.
Do you guys have any idea, why this error is thrown?