Application.internetReachability is always NotReachable on start

Hi,

As of 2019.2f1, the internetreachability state is always notreachable when starting the application, and then changes to the right state after a second or so.

The changelog doesn’t mention a change in behaviour,

Is this expected somehow?

1 Like

Yes. It requires time to check if internet is reachable or not.

Thanks, how come this wasn’t the case before? Is this change documented somewhere?

Idk, it’s so obvoius. You need to actually ping something on the internet to check if internet is reachable.

I’m not asking for for a check of internet reachability, that isn’t what internetReachability indicates (confusingly). I want to know if the device is connected to wifi, regardless of internet access state.

This state used to be available immediately, and the fact that it isn’t now is not ‘so obvious’. Plenty of initialization gets done before the first scene loads, this could’ve easily been one of those things (and it used to be).

This problem also occurs on my Android. (Unity 2019.2.0f1)

Always the first Application.internetReachability is “NotReachable” …

1 Like

A ping wouldn’t get you information on whether the internet is reachable via cellular connection or via a LAN connection, which this method provides. Therefore, it’s not getting this information by pinging, but by checking to see what the OS says about its network connectivity, and that should be instant. The only thing I can think is that it must be doing a ping in addition to checking with the OS, but that is very counterintuitive, at least to me.

Either way, the real problem is that there is no distinction between “we haven’t pinged” and “we pinged and it failed”. Perhaps there could be an additional “InternetReachability.Unconfirmed” state indicating that it has not yet finished checking?

2 Likes

I got the same problem on Android devices.
It’s working well on iOS and Editor but Android always return internet is not reachable when checking.