Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QNetworkInformation::isBehindCaptivePortal() incorrectly returns false on MacOS
Qt 6.12 LTS is out! See what's new in the release blog

QNetworkInformation::isBehindCaptivePortal() incorrectly returns false on MacOS

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 2 Posters 448 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    GelaMalekPour
    wrote on last edited by
    #1

    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;
        }
    
    Axel SpoerlA 1 Reply Last reply
    0
    • G GelaMalekPour

      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;
          }
      
      Axel SpoerlA Offline
      Axel SpoerlA Offline
      Axel Spoerl
      Moderators
      wrote on last edited by Axel Spoerl
      #2

      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, if QT_FEATURE_networklistmanager is enabled).

      Detection support for Apple platforms hasn't been implemented (yet). That's why it returns falsealways.

      Cheers
      Axel

      Software Engineer
      The Qt Company, Oslo

      1 Reply Last reply
      2
      • G GelaMalekPour has marked this topic as solved on

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt
      • Unsolved