Thank you for reporting this bug. We will make it our priority to review this report.
Ext.device.Connection: online status & connection type not updated on iOS app resume
Ext version tested:
- Sencha Touch 2.1.0 RC2
- Sencha Cmd 220.127.116.11
Steps to reproduce the problem:
- Sencha Touch 2 apps (native-packaged for iOS) that are using Ext.device.Connection will get wrong online status and connection type when the application is paused, then the connection status/type changes, and then the application is resumed.
The result that was expected:
- Create a Sencha Touch 2 app that internally uses Ext.device.Connection.isOnline() and/or Ext.device.Connection.getType() and in such a way that a user action can trigger calling them (e.g. on tapping a button)
- Package the application as native iOS application
- Install the application on iOS device
- Start the application on iOS and note the connection status and type returned
- Pause the application
- Go to Settings of iOS and change the actual connection status or type (e.g. if there was a connection to Internet, then go to the airplane mode, or switch off Wi-Fi, or alike)
- Resume the application and make it calling Ext.device.Connection.isOnline() and/or Ext.device.Connection.getType() once again (with the appropriate user action)
- Note the connection status and type returned this time
The result that occurs instead:
- The returned connection status and type are in sync with the actual connection status and type on the device
- The returned connection status and type remain exactly the same as they are when the application is started first
- Create a new Sencha Touch application with 'sencha generate app'
- Replace the original Main.js file with the file attached to this report
- Package as native iOS app and install on iOS device
- Start the iOS app on the device, note the connect status and type
- Pause the application, change the connection status/type, and then resume the application
- Press the "Refresh Info" button to update the connection status and type. See the connection status and type returned.
First thing I see is you are breaking inheritance by not calling the parent in initialize. You need to add a this.callParent();
I updated the attached file. Well-spotted, Mitchell. Thanks. Mea culpa.
Any chance you can get back to this one, please?
Subscribe to the issue, when it will be fixed?
Sencha Touch 2.2.0
Sencha Cmd v18.104.22.1682
Still does not work
Any solution or work around found?
Ext.device.Connection does not work on native IOS after ST 2.0.1
Just a quick note to all those still suffering from that unpleasant issue (to be fixed some day, I hope):
- If you only need to check from your app (packaged and running as native) if it is on-line or not. Then you have a simple and easy alternative:
Thank you so much for your thread, its really helped me to get connection status, I tried with Ext.device.connection so may times but no success in my IPod, navigator.onLine worked for me both in IOS and Android