[
https://issues.apache.org/jira/browse/CB-13675?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16295185#comment-16295185
]
Jacques L. CHEREAU edited comment on CB-13675 at 12/18/17 5:07 PM:
-------------------------------------------------------------------
Same code works fine with iOS 10.3.3 on iPhone 5C, so I doubt the issue is with
the code.
Nevertheless the test I use is:
{code:javascript}
if ((window.device && window.device.platform === 'browser' &&
!window.navigator.onLine) || ('Connection' in window &&
window.navigator.connection.type === window.Connection.NONE)) {
// query data from IndexedDB
window.alert('offline');
} else {
// query data from Restful API with $.ajax and cache relevant data in
IndexedDB
window.alert('online');
}
{code}
Note that with 3G but without Wifi:
{code:javascript}
window.alert(
'platform: ' + window.device.platform +
'\nonLine: ' + window.navigator.onLine +
'\ntype: ' + window.navigator.connection.type +
// Note: there used to be window.navigator.network.isReachable function -
@see
https://www.neotericdesign.com/articles/2011/3/checking-the-online-status-with-phonegap-jquery
// '\nreachable: ' + ($.isFunction(window.navigator.network.isReachable) ?
window.navigator.network.isReachable() : 'N/A') +
// '\neffective: ' + window.navigator.connection.effectiveType +
'\nOffline test: ' + (('Connection' in window &&
window.navigator.connection.type === window.Connection.NONE) || (window.device
&& window.device.platform === 'browser' && !window.navigator.onLine))
);
{code}
displays on iOS 11:
!https://issues.apache.org/jira/secure/attachment/12902678/iOS11.png!
and displays on iOS10:
!https://issues.apache.org/jira/secure/attachment/12902679/iOS10.png!
was (Author: jlchereau):
Same code works fine with iOS 10.3.3 on iPhone 5C, so I doubt the issue is with
the code.
Nevertheless the test I use is:
{code:javascript}
if ((window.device && window.device.platform === 'browser' &&
!window.navigator.onLine) || ('Connection' in window &&
window.navigator.connection.type === window.Connection.NONE)) {
// query data from IndexedDB
window.alert('offline');
} else {
// query data from Restful API with $.ajax and cache relevant data in
IndexedDB
window.alert('online');
}
{code}
Note that with 3G but without Wifi:
{code:javascript}
window.alert(
'platform: ' + window.device.platform +
'\nonLine: ' + window.navigator.onLine +
'\ntype: ' + window.navigator.connection.type +
// Note: there used to be window.navigator.network.isReachable function -
@see
https://www.neotericdesign.com/articles/2011/3/checking-the-online-status-with-phonegap-jquery
// '\nreachable: ' + ($.isFunction(window.navigator.network.isReachable) ?
window.navigator.network.isReachable() : 'N/A') +
// '\neffective: ' + window.navigator.connection.effectiveType +
'\nOffline test: ' + (('Connection' in window &&
window.navigator.connection.type === window.Connection.NONE) || (window.device
&& window.device.platform === 'browser' && !window.navigator.onLine))
);
{code}
displays on iOS 11:
and displays on iOS10:
!https://issues.apache.org/jira/secure/attachment/12902679/iOS10.png!
> cordova-plugin-network-information reports type === NONE when connected
> through 3G/4G on iOS 11
> -----------------------------------------------------------------------------------------------
>
> Key: CB-13675
> URL: https://issues.apache.org/jira/browse/CB-13675
> Project: Apache Cordova
> Issue Type: Bug
> Components: AllPlugins
> Affects Versions: [email protected], [email protected]
> Environment: iPhone SE
> iOS 11.2
> Vodafone UK + WiFi
> Phonegap Cli 6.5.0 and 7.0.1
> cordova-ios 4.3.1 and 4.4.0
> cordova-plugin-network-information 1.3.4
> Reporter: Jacques L. CHEREAU
> Attachments: iOS10.png, iOS11.png
>
>
> When an iPhone (SE) with iOS 11.2 is disconnected from WIFI *+but connected
> to a CELL network+* (Vodafone UK) either;
> * by being out of reach of a WIFI network, or
> * by forgetting the WIFI network in iOS settings or
> * by disabling WIFI in the iOS control panel:
> then
> # A cordova/phonegap app reports navigator.connection.type ===
> Connection.NONE instead of Connection.CELLxxx
> # Upon launching such cordova/phonegap app an offline event is triggered
>
> This issue has also been reported by someone else in the ionic forums
> [https://forum.ionicframework.com/t/cordova-network-plugin-is-not-working-in-ios-version-11-but-was-working-in-version-10/111326].
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]