WWDC 2018 Todays Internet: replacing Reachability with ...?

I watched this for the first time on a plan ride yesterday. During the session it was stated there is a technique that can replace reachabilty:


"There is one case we've seen with developers which does make sense which is if you're going to have the user answer a lot ofinformation in a form, you may not want to waste the user's time if you have good reason to believe that may later fail.

If that is the use case you care about, stay after the break because we have a new way to do that that's much better."


(Ref asciiwwdc 2018 sessions 714)


Of course there are no notes from the break. Does anyone have a reference to this technique?

Accepted Reply

So I was going to post this question again, when I saw I already had done so 2 years ago!


I poked around today and sort of answered my own question. The Network framework has this NWPathMonitor - it gives you notification when things change - WIFI state changes, celllular, even more.


But what really helps if that you can find out if you can reach the "real" internet. You can probe if there is an active DNS and gateway(s).


This is exactly what I had been looking for. Its not pinging the target host, but I now believe its as good as Reachability if not better (I understand Reachability is just confirming it can access the desired host entry in a DNS)


What really cleared this up for me was an article written by Ross Butler : "Detecting Internet Access on iOS 12+". He also talks about how to use this framework to detect "Captive Portals" too.


PS: my situation today is that the iOS device running my app will switch between internet wifi and a local hardware device. The above works perfect to know what the connection is!

Replies

I don’t have time to grovel through the transcript right now but slide 127 of WWDC 2018 Session 715 Introducing Network.framework: A modern alternative to Sockets says:

Along with connection state

.waiting
, replaces
SCNetworkReachability

so it seems likely that it was actually covered there (-:

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

So I was going to post this question again, when I saw I already had done so 2 years ago!


I poked around today and sort of answered my own question. The Network framework has this NWPathMonitor - it gives you notification when things change - WIFI state changes, celllular, even more.


But what really helps if that you can find out if you can reach the "real" internet. You can probe if there is an active DNS and gateway(s).


This is exactly what I had been looking for. Its not pinging the target host, but I now believe its as good as Reachability if not better (I understand Reachability is just confirming it can access the desired host entry in a DNS)


What really cleared this up for me was an article written by Ross Butler : "Detecting Internet Access on iOS 12+". He also talks about how to use this framework to detect "Captive Portals" too.


PS: my situation today is that the iOS device running my app will switch between internet wifi and a local hardware device. The above works perfect to know what the connection is!