[TIMOB-17495] Ti.Network.online and change events do not work reliably
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Open |
Resolution | Unresolved |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | iOS |
Labels | ios, network |
Reporter | Eric Wieber |
Assignee | Unknown |
Created | 2014-08-12T18:42:37.000+0000 |
Updated | 2018-02-28T20:04:11.000+0000 |
Description
We are using the Ti.Network.online to check of data connection exist (does not matter if it is data, Wifi or other) usually this has been reliable, but now it returns true most of the time or actually presently all the time... We have seen this both in Sim and Device (iPhone5, iOS 7)
We also tried the change event and just print the object returned, it says online even without any data contact
We are critically depending on this and it is a blocker for app deploy, can you please help?
I used this code in alloy.js
Ti.Network.addEventListener('change', function(e) {
Ti.API.info('NETWORK STAT: ' + JSON.stringify(e));
Ti.API.info('NETWORK : ' + e.online + ' type: ' + e.networkType);
//7networkIsOnline = e.online;
//networkType = e.networkType;
});
and got this result:
NETWORK STAT: {"online":true,"networkType":1,"networkTypeName":"WIFI","bubbles":true,"type":"change","source":{},"cancelBubble":false}
[INFO] : NETWORK : true type: 1
[INFO] : NETWORK STAT: {"online":true,"networkType":1,"networkTypeName":"WIFI","bubbles":true,"type":"change","source":{},"cancelBubble":false}
[INFO] : NETWORK : true type: 1
this is a off and on switching of the network... and as you can see it remains true!!
Please help
Attachments
File | Date | Size |
---|---|---|
alloy.js | 2014-08-12T18:42:37.000+0000 | 624 |
index.js | 2014-08-12T18:42:37.000+0000 | 104 |
Online.mov | 2014-08-12T18:42:37.000+0000 | 4847322 |
Can you please try this in 3.3.0.GA as we changed iOS networking? I'm curious if this makes a difference.
Customer finally responded. They continue to encounter this on 3.3.0.GA. They also claim they encounter this on 3.4.0.GA, although I am unable to reproduce it there: iPhone 6, iOS 8.0 & iPhone 5 Sim, iOS 8.0 & iPhone 5S Sim, iOS 7.1 Titanium SDK 3.4.0.GA Studio 3.4.0
the problem persist in 3.5.0: just try this steps with this code in alloy.js Ti.Network.addEventListener( 'change', function( e ) { Ti.API.info(e); } ); 1st step: wifi connection active : network = wifi 2nd wifi connection disabled and mobile network active -> network = mobile 3rd airport mode active -> network for a second is NONE with online false then change to MOBILE and online true
I'm still seeing issues in 6.3.0 GA