[TIMOB-25907] Ti.Network.getOnline() messed up unless consoled before
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Open |
Resolution | Unresolved |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | n/a |
Labels | engSchedule, ios, simulator, titanium |
Reporter | josh.mocek |
Assignee | Eric Merriman |
Created | 2018-03-22T18:53:34.000+0000 |
Updated | 2019-06-25T15:37:44.000+0000 |
Description
Just create the sample hello world app in appcelerator and use the code below in the index.js file.
function doClick(e) {
console.info('Ti.Network.online: ' + Ti.Network.getOnline());
if (Ti.Network.getOnline()) alert($.label.text);
}
$.index.open();
Start the app in an iOS simulator, click 'Hello, World'. The alert should pop up. Then turn off your wifi on your computer, the alert shouldn't pop up. Then turn your wifi back on. If the console.info is uncommented then the alert will work properly. If there is no console then the alert will not pop up.
Hello, The issue you described is not clear. In my observation, I see when I turn back my WIFI, I don't get the alert by clicking the label anymore and the console is showing "[INFO] Ti.Network.online: false". But it's not true since I turned on the WIFI. Is this your issue?
yeah, that's my issue
but it fixed it for me if I consoled Ti.Network.getOnline() before it and the alert would then pop up
Any update on this?
Happy new year!