Skip to content

feat(network): Add internet reachability support#2564

Open
sc-nick wants to merge 2 commits into
ionic-team:mainfrom
sc-nick:network-internet-reachability
Open

feat(network): Add internet reachability support#2564
sc-nick wants to merge 2 commits into
ionic-team:mainfrom
sc-nick:network-internet-reachability

Conversation

@sc-nick

@sc-nick sc-nick commented Jul 14, 2026

Copy link
Copy Markdown

Description

Extends @capacitor/network with actual internet reachability information while preserving the existing connection detection behavior and API structure.

This plugin now reports whether the internet is actually reachable, allowing applications to distinguish between being connected to a network and having a real internet access.

Changes

  • Adds internetReachable to indicate whether internet access is available
  • Adds state with the following values:
    • offline: no network connection
    • online: connected with internet access
    • limited: connected to a network without internet access
  • Keeps the existing connected and connectionType fields unchanged
  • Keeps the existing getStatus() method and networkStatusChange event

Platform implementation

  • iOS: keeps the existing Reachability connection monitoring and adds HTTP probs to verify internet access
  • Android: uses NET_CAPABILITY_VALIDATED to determine whether the active network has internet access

Example payload

{ "connected": true, "connectionType": "wifi", "internetReachable": false, "state": "limited" }

Change Type

  • Fix
  • Feature
  • Refactor
  • Breaking Change
  • Documentation
  • Other (CI, chores, etc.)

Rationale / Problems Fixed

The @capacitor/network plugin currently doesn't report whether internet access is actually available. As a result application using the plugin may incorrectly assume that online operations can succeed whenever a network connection is available.

Platforms Affected

  • Android
  • iOS
  • Web

@sc-nick sc-nick marked this pull request as ready for review July 14, 2026 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant