Titanium JIRA Archive
Appcelerator Community (AC)

[AC-1965] iOS7: iPhone 4S mobile data only reports no data connection

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionCannot Reproduce
Resolution Date2013-11-20T01:23:12.000+0000
Affected Version/sn/a
Fix Version/sn/a
Componentsn/a
Labels4s, data, dev-investigate, ios7, network
ReporterMartin Williamson
AssigneeMauro Parra-Miranda
Created2013-11-18T15:11:57.000+0000
Updated2016-03-08T07:40:54.000+0000

Description

Using 
  
if (Titanium.Network.networkType === Titanium.Network.NETWORK_NONE) {
   return false;
}
else {
   return true;
}
or
if (Titanium.Network.online) {
    return true;
}
else {
    return false;
}
Always returns false on the iPhone 4S running iOS 7 Functions as expected on iPhone 5 on iOS 7 and Android.

Comments

  1. kosso 2013-11-19

    Which Titanium SDK version are you using?
  2. Martin Williamson 2013-11-19

    Titanium Studio, build: 3.1.4.201310171935 Titanium SDK 3.1.3.GA Sorry forgot to add this initially
  3. Martin Williamson 2013-11-19

    none issue, someone had disabled data for the app specifically in settings on the development phone, so sorry
  4. Pedro Enrique 2013-11-20

    Tested with iPhone 4S and iOS 7.0.4 Cannot reproduce:
       [INFO] Titanium.Network.online
       [INFO] 1
       [INFO] Titanium.Network.networkType === Titanium.Network.NETWORK_NONE
       [INFO] 0
       
    Used this code:
       var w = Ti.UI.createWindow({
           backgroundColor: "#e1e1e1"
       });
        
       var btn = Ti.UI.createButton({
           title: 'connected?'
       })
       w.add(btn);
       
       var x = 0;
       btn.addEventListener('click', function(){
           if(x % 2) {
               Ti.API.info('Titanium.Network.networkType === Titanium.Network.NETWORK_NONE');
               Ti.API.info(Titanium.Network.networkType === Titanium.Network.NETWORK_NONE);
                   if (Titanium.Network.networkType === Titanium.Network.NETWORK_NONE) {
                      alert(false);
                   }
                   else {
                      alert(true);
                   }
           } else {
               Ti.API.info('Titanium.Network.online');
               Ti.API.info(Titanium.Network.online);
               if (Titanium.Network.online) {
                  alert(true);
               }
               else {
                  alert(false);
               }
           }
           x++;
       });
       
       w.open();
       
  5. Mauro Parra-Miranda 2013-11-21

    Closed as per Martin's comment about disabling the data in the device.

JSON Source