Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. QNetworkConfigurationManager on iphone ios events?
Forum Updated to NodeBB v4.3 + New Features

QNetworkConfigurationManager on iphone ios events?

Scheduled Pinned Locked Moved Solved Mobile and Embedded
4 Posts 2 Posters 1.1k Views 2 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.
  • MetalMajorM Offline
    MetalMajorM Offline
    MetalMajor
    wrote on last edited by
    #1

    Can I expect events on the iphone to occur when the network config is changing or do I need to repeatedly call updateConfigurations() on the manager to have the latest situation?

    I am testing it and when putting the phone to airplane mode and back, nothing is fired. I am checking :

    • updateCompleted
    • onlineStateChanged
    • configurationChanged
    • configurationAdded
    • configurationRemoved

    I want to know if the phone has an internet connection or not without polling the whole time (to save some battery life).

    I am using Qt 5.9.2 on ios 11 with the latest xcode 9.0.

    ekkescornerE 1 Reply Last reply
    0
    • MetalMajorM MetalMajor

      Can I expect events on the iphone to occur when the network config is changing or do I need to repeatedly call updateConfigurations() on the manager to have the latest situation?

      I am testing it and when putting the phone to airplane mode and back, nothing is fired. I am checking :

      • updateCompleted
      • onlineStateChanged
      • configurationChanged
      • configurationAdded
      • configurationRemoved

      I want to know if the phone has an internet connection or not without polling the whole time (to save some battery life).

      I am using Qt 5.9.2 on ios 11 with the latest xcode 9.0.

      ekkescornerE Offline
      ekkescornerE Offline
      ekkescorner
      Qt Champions 2016
      wrote on last edited by
      #2

      @MetalMajor onlineStateChanged isn't reliable on iOS.
      see https://bugreports.qt.io/browse/QTBUG-56151
      but there's an easy workaround: use iOS Reachability Class
      see my blog:
      https://appbus.wordpress.com/2017/06/23/issues-and-workarounds-update-qt-5-8-0-qt-5-9-0/ (scroll down)
      this works very well - I'm using it in all my apps

      ekke ... Qt Champion 2016 | 2024 ... mobile business apps
      5.15 --> 6.9 https://t1p.de/ekkeChecklist
      QMake --> CMake https://t1p.de/ekkeCMakeMobileApps

      1 Reply Last reply
      2
      • MetalMajorM Offline
        MetalMajorM Offline
        MetalMajor
        wrote on last edited by
        #3

        Thanks! I had something based on the same Reachability, but it was too complicated :) most probably because I don't know any objective c :p your solution is muuuch simpler!! thanks...

        ekkescornerE 1 Reply Last reply
        0
        • MetalMajorM MetalMajor

          Thanks! I had something based on the same Reachability, but it was too complicated :) most probably because I don't know any objective c :p your solution is muuuch simpler!! thanks...

          ekkescornerE Offline
          ekkescornerE Offline
          ekkescorner
          Qt Champions 2016
          wrote on last edited by
          #4

          @MetalMajor great to hear :)

          ekke ... Qt Champion 2016 | 2024 ... mobile business apps
          5.15 --> 6.9 https://t1p.de/ekkeChecklist
          QMake --> CMake https://t1p.de/ekkeCMakeMobileApps

          1 Reply Last reply
          0

          • Login

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