QNetworkInformation::isBehindCaptivePortal() incorrectly returns false on MacOS
-
Hey all,
I would like to use
QNetworkInformation::isBehindCaptivePortal()to determine if the network is behind a captive portal. When I test my code, it is always coming back as false even when I am in fact behind a captive portal (network is connected but not yet authenticated). I'm on MacOS Sonoma 14.1 which I believe is a supported platform. Is this a genuine bug or am I missing something? Where can I find a list of all supported platforms?Here's the relevant snippet:
if (QNetworkInformation::instance()->isBehindCaptivePortal()) { emit activationBlockedForCaptivePortal(); Navigator::instance()->requestScreen(MozillaVPN::ScreenCaptivePortal); m_portalDetected = false; return true; } -
Hey all,
I would like to use
QNetworkInformation::isBehindCaptivePortal()to determine if the network is behind a captive portal. When I test my code, it is always coming back as false even when I am in fact behind a captive portal (network is connected but not yet authenticated). I'm on MacOS Sonoma 14.1 which I believe is a supported platform. Is this a genuine bug or am I missing something? Where can I find a list of all supported platforms?Here's the relevant snippet:
if (QNetworkInformation::instance()->isBehindCaptivePortal()) { emit activationBlockedForCaptivePortal(); Navigator::instance()->requestScreen(MozillaVPN::ScreenCaptivePortal); m_portalDetected = false; return true; }Good morning,
The documentation isn't clear about which platforms are supported wrt captive portal detection.
It's supported for Android, Glib, Networkmanager (DBus) and Networklistmanager (on Windows, ifQT_FEATURE_networklistmanageris enabled).Detection support for Apple platforms hasn't been implemented (yet). That's why it returns
falsealways.Cheers
Axel -
G GelaMalekPour has marked this topic as solved on