From d5adfb97dde9fd136fe25abb6eef2023f52c5eb4 Mon Sep 17 00:00:00 2001 From: Santo Shakil Date: Tue, 21 Jul 2026 22:02:36 +0600 Subject: [PATCH] fix(mobile): treat wired ethernet as unmetered on ios (#29351) check the metered flags instead of the interface type, so ethernet counts like android already does. --- .../Connectivity/ConnectivityApiImpl.swift | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/mobile/ios/Runner/Connectivity/ConnectivityApiImpl.swift b/mobile/ios/Runner/Connectivity/ConnectivityApiImpl.swift index f104314fae..e88b7a0fd6 100644 --- a/mobile/ios/Runner/Connectivity/ConnectivityApiImpl.swift +++ b/mobile/ios/Runner/Connectivity/ConnectivityApiImpl.swift @@ -43,15 +43,16 @@ class ConnectivityApiImpl: ConnectivityApi { capabilities.append(.vpn) } - // Determine if connection is unmetered: - // - Must be on WiFi (not cellular) - // - Must not be expensive (rules out personal hotspot) - // - Must not be constrained (Low Data Mode) - // Note: VPN over cellular should still be considered metered + // Determine if connection is unmetered from the OS metered flags rather than + // the interface type, so wired ethernet (iPhone USB adapters, Apple Silicon + // Macs) is treated as unmetered like Wi-Fi: + // - Not on cellular + // - Not expensive (also rules out cellular and personal hotspot) + // - Not constrained (Low Data Mode) + // Note: VPN over cellular stays metered because the path is still expensive. let isOnCellular = path.usesInterfaceType(.cellular) - let isOnWifi = path.usesInterfaceType(.wifi) - - if isOnWifi && !isOnCellular && !path.isExpensive && !path.isConstrained { + + if !isOnCellular && !path.isExpensive && !path.isConstrained { capabilities.append(.unmetered) }