Unclaimed Package Is this your package? Claim it to unlock full analytics and manage your listing.
Claim This Package

Install via UPM

Add to Unity Package Manager using this URL

https://www.pkglnk.dev/ez-internet-checker.git

README Markdown

Copy this to your project's README.md

Style
Preview
pkglnk installs badge
## Installation

Add **Easy Internet Checker** to your Unity project via Package Manager:

1. Open **Window > Package Manager**
2. Click **+** > **Add package from git URL**
3. Enter:
```
https://www.pkglnk.dev/ez-internet-checker.git
```

[![pkglnk](https://www.pkglnk.dev/badge/ez-internet-checker.svg?style=pkglnk)](https://www.pkglnk.dev/pkg/ez-internet-checker)

README

InternetChecker Unity Plugin

InternetChecker is a lightweight Unity plugin that allows you to verify actual internet connectivity โ€” not just network connection โ€” by using multiple captive portal detection methods (Google204, Apple, MicrosoftNCSI, etc.). It helps avoid false positives from local Wi-Fi and detects when a captive portal is blocking internet access.


๐Ÿ“ฆ Install via Unity Package Manager

To install InternetChecker as a Git-based package, add the following line to your Packages/manifest.json file:

{
  "dependencies": {
    "ez-internet-checker": "https://github.com/easy-assets/ez-internet-checker.git#v1.0.0"
  }
}

โœ… This fetches the plugin from GitHub and adds it to your Unity project automatically.


โš™๏ธ Quick Start Guide

Step 1: Open the Settings Window

In Unity Editor, go to:

Tools โ†’ Network โ†’ Internet Checker Settings

You should see a window like this:

Open Settings


Step 2: Create or Load the Configuration Asset

If no configuration file exists, the plugin will automatically create one at:

Assets/Settings/Network/InternetCheckerSettings.asset

This file stores your detection method, fallbacks, and timeout settings.


Step 3: Configure Checking Options

  • Select your Primary Method (e.g., Google204, Apple)
  • Add any Fallback Methods
  • Customize:
    • Timeout (seconds)
    • Cache Interval (seconds)
    • Custom URL (if using Custom method)

Click โ€œTest Internet Connectionโ€ in the editor to verify your setup.


๐Ÿš€ Runtime Usage

The InternetCheckManager is a Singleton.

Access it from anywhere:

var manager = InternetCheckManager.Instance;

Make sure a single InternetCheckManager exists in your scene. You donโ€™t need to assign the settings manually โ€” the instance will use the configured InternetCheckerSettings.asset.


๐Ÿ” Example: Async Check

private async void Start()
{
    bool isConnected = await InternetCheckManager.Instance.IsInternetAvailable();
    Debug.Log("Internet: " + isConnected);
}

๐Ÿ”„ Example: Coroutine Check

private void Start()
{
    StartCoroutine(CheckConnection());
}

private IEnumerator CheckConnection()
{
    yield return CoroutineTaskExtensions.WaitForTask(
        InternetCheckManager.Instance.IsInternetAvailable(),
        result => Debug.Log("Internet available: " + result)
    );
}

๐Ÿ›  Features

  • โœ… Detect real internet connectivity (not just local network)
  • ๐ŸŒ Supports 16 detection methods:
    • Google204 / GoogleBlank
    • Apple / Apple HTTPS
    • MicrosoftNCSI / ConnectTest
    • Ubuntu
    • Custom URLs
  • ๐Ÿšซ Detects captive portals (e.g., hotel login pages)
  • ๐Ÿ” Method fallback support
  • ๐Ÿง  Internal caching to reduce network calls
  • ๐ŸŽฎ UnityEvent callback support (OnInternetStatusChecked)

๐Ÿ“ Default Asset Location

  • InternetCheckerSettings:
    Assets/Settings/InternetChecker/InternetCheckerSettings.asset

Now you're ready to use InternetChecker reliably in your Unity games!

Comments

No comments yet. Be the first!