Internet Reachability Verifier for Unity.
LINK TO ASSET WEBSITE: Internet Reachability Verifier website.
So what does it do? After all, there’s already Application.internetReachability in the Unity API.
Application.internetReachability has a bit misleading name - it actually tells if it is technically possible for you to try to use the network. So, on a desktop machine it will always tell you that you can. On a mobile device it’s nice for checking if you’re really offline, or if you can try to make a connection (and if it is going to use WiFi or carrier data).
However, when using public WiFi, quite often you need to go through a login web page before the internet truly works. In such wireless network, any WWW request will actually give you the login page instead of the data you actually wanted. This is the situation where you want to use Internet Reachability Verifier.
What features does Internet Reachability Verifier have?
Accompanying pdf manual contains more details of each feature listed below.
-
Automatically monitors and verifies internet reachability, implemented using a light-weight coroutine.
-
If internet connectivity stops working middle of your own networking and you get error codes from some networking library, you can ask for reverification of the internet reachability (this asset will not actively monitor loss of effective networking, as that would use up user’s mobile data quota unnecessarily).
-
16 different captive portal detection methods: Google204, Google204HTTPS, GoogleBlank, MicrosoftNCSI, MicrosoftNCSI_IPV6, Apple, Apple2, AppleHTTPS, Ubuntu, UbuntuHTTPS, MicrosoftConnectTest, MicrosoftConnectTest_IPV6, Custom.
-
Default setting is to automatically pick a suitable (“native”) captive portal detection method by platform.
-
Optional delegate for matching returned data for using custom method.
-
Optionally append cache buster to url when using the custom method.
-
Detailed internet access status property (Offline, PendingVerification, Error, Mismatch, NetVerified).
-
Easy callback for listening to changes in the internet access status property (optional).
About the implementation
- Works with Desktop, Mobile and WebGL platforms
- No native code.
- C# source code included.
- Small footprint. No nonsense of 100+ files. Whole asset package contains only a few files, and the actual needed code for your project is in a single MonoBehaviour (.cs file).
- Supports Unity 6+, 2023, 2022, 2021, 2020, 2019, 2018, 2017
- This is the original asset for this functionality. It’s maintained & most up-to-date.
- Works with iOS app transport security and Android 9.0+ network security config.
Internet Reachability Verifier website
Other assets from Strobotnik: Google Universal Analytics for Unity, Dynamic Text, Klattersynth TTS