Hello! Can somebody please tell me if there is a d...
# ktor
m
Hello! Can somebody please tell me if there is a definitive way to tell that there is no internet connection in ktor client for ios (darwin) ? (edit) : What will be the best practise for checking internet connectivity using ktor on mobile platforms?
s
There's no definitive way. You can send requests to known servers and URLs, but if they don't respond, you can't really tell whether the problem is at their end or yours. Even with access to platform-specific APIs like Android's connectivity manager, you can only really tell whether the network interface is enabled. It could still be enabled but not connected to the internet, or connected in some defective way where it can only reach certain addresses.
I don't know about best practice, but the common practice is just to hit google.com and see if you get a reply 😄
m
Thank you! 🙌