Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-17495] Ti.Network.online and change events do not work reliably

GitHub Issuen/a
TypeBug
PriorityLow
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
ComponentsiOS
Labelsios, network
ReporterEric Wieber
AssigneeUnknown
Created2014-08-12T18:42:37.000+0000
Updated2018-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

FileDateSize
alloy.js2014-08-12T18:42:37.000+0000624
index.js2014-08-12T18:42:37.000+0000104
Online.mov2014-08-12T18:42:37.000+00004847322

Comments

  1. Ingo Muschenetz 2014-08-12

    Can you please try this in 3.3.0.GA as we changed iOS networking? I'm curious if this makes a difference.
  2. Eric Wieber 2014-10-28

    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
  3. paolo mosca 2015-02-16

    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
  4. Joshua A. Ceaser 2018-01-31

    I'm still seeing issues in 6.3.0 GA

JSON Source