It appears that the System.isOnline call from the QML Extras API does not work on iPad's with iOS 9. We periodically call that to check for an active internet connection and react accordingly in our app when our users are no longer connected. On our iOS 9 iPad, the device thinks it's always connected even when we shut down WiFi and cellular access.
Has anyone else seen this, and if so are there any workarounds available? We're using Qt 5.4.1 and the 10.2.6 API.
Solved! Go to Solution.
For anyone else running into this, it seems to be an issue with Qt's underlying QNetworkConfigurationManager class and some VPN software on Andy's devices. It seems that the isOnline functionality that comes from this class may detect if there is an online connection, but is not able to determine if you have authenticated and can actually use the internet. For example, if you were in a hotel connected to the guest network, but have not yet provided your credentials. I created a standalone test app that just calls the C++ class without any ArcGIS APIs around it, and the issue still happens, so it has been logged with Qt [QTBUG-50518] QNetworkConfigurationManager isOnline not returning correct value - Qt Bug Tracker
Here is all that is really happening under the hood:
m_networkConfig = new QNetworkConfigurationManager(this); m_networkConfig->isOnline();
-Luke
Hmm, I haven't gotten to test this, but I wonder if it would happen with Qt 5.5.1? 5.4.1 came out before iOS 9, so maybe there is some missing link here. Also, I wonder what version of Xcode you are using.
-Luke
Here's the answer I got from our iOS guy. Turns out he is already using 5.5.1.
"We are using Xcode 6.4 and we cannot use Xcode 7 which is the release that came out for iOS 9 because QT doesn’t support it yet. We are already using QT 5.5.1."
Sounds like it is probably a bug with Qt then. Our Extras library is just a straight wrap up of several Qt C++ classes. In the case of System.isOnline, it is just QNetworkConfigurationManager's isOnline check being wrapped and exposed as a Q_PROPERTY for use in QML. QNetworkConfigurationManager Class | Qt Network 5.5
-Luke
Yeh I figured as much. This puts us in quite a pickle. Are you guys able to repro this on your side?
It seems to work alright for me. Here's my versions of everything:
Qt 5.5
Xcode 6.4
ArcGIS Runtime SDK 10.2.6
iOS 9.1
Here is my code. As I turn airplane mode on and off, then I click the button, I see the text updated. Do you see this?
import QtQuick 2.3 import QtQuick.Controls 1.2 import ArcGIS.Extras 1.0 ApplicationWindow { id: appWindow width: 800 height: 600 Text { id: text } Button { anchors.centerIn: parent onClicked: { text.text = "online? " + System.isOnline } } }
Lucas
Just built your app and deployed it to an IPad. It does not work for me. I also ran it in OSX and it does not work there either. I checked my iPad and it is actually 9.2 but the fact that it doesn't work on my mac either is a little strange.
Any Ideas?
James
Weird... I'm stumped. Did you give it a few seconds after you switched from airplane mode? I noticed I had to click the button a few times, because it would take a few seconds for the system to register that it was online/offline. Does it work on a windows machine, or some other OS for you?
Hi Lucas
I did some more testing and I think it may be something to do with a cellular enabled iOS device. On an iPad regardless of whether I have cellular data switched off and wifi off or airplane mode it still returns true (Even waiting a while).
On an IPhone 6 it returns false in airplane mode but still returns true when cellular data is off and wifi is off.
For anyone else running into this, it seems to be an issue with Qt's underlying QNetworkConfigurationManager class and some VPN software on Andy's devices. It seems that the isOnline functionality that comes from this class may detect if there is an online connection, but is not able to determine if you have authenticated and can actually use the internet. For example, if you were in a hotel connected to the guest network, but have not yet provided your credentials. I created a standalone test app that just calls the C++ class without any ArcGIS APIs around it, and the issue still happens, so it has been logged with Qt [QTBUG-50518] QNetworkConfigurationManager isOnline not returning correct value - Qt Bug Tracker
Here is all that is really happening under the hood:
m_networkConfig = new QNetworkConfigurationManager(this); m_networkConfig->isOnline();
-Luke