Hi,
I'm actually getting an issue with the current code in my alloy app. Here is the part of the code :
console.log(Ti.Network.networkType); console.log(Ti.Network.online); console.log(Ti.Network.networkTypeName); Ti.Network.addEventListener('change', function(e) { console.log(e.networkType); console.log(e.online); console.log(e.networkTypeName); if(e.networkType != Titanium.Network.NETWORK_NONE) { if(!Alloy.Globals.isLoggedIn) { Alloy.createController('connexion').getView().open(); } } });On the launch of the app (on a device where the airplane mode is on). The logs give me this :
[INFO] 0 [INFO] false [INFO] NONE [INFO] 2 [INFO] true [INFO] MOBILEThe first logs outside of the addEventListener, give me the right answer. But the logs inside give me a wrong answer ! And of course I need this evenListener for my app :/ I don't want to do a setInterval, because it will unnecessarily use the device ressources.
Is this a known bug ? Thanks for the reply.
PS: some info :
- Application type : mobile
- Titanium SDK : 4.1.0.GA
- Platform & version : Android (OxygenOs) 5.0
- Device : OnePlus One