28 Oct 2012 8:53 AM #1
Ext.device.Connection: online status & connection type not updated on iOS app resume
Ext version tested:
- Sencha Touch 2.1.0 RC2
- Sencha Cmd 184.108.40.206
- 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.
- 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 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.
29 Oct 2012 5:12 AM #2
- Join Date
- Mar 2007
- Gainesville, FL
- Vote Rating
First thing I see is you are breaking inheritance by not calling the parent in initialize. You need to add a this.callParent();Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Software Engineer
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services firstname.lastname@example.org
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!
When posting code, please use BBCode's CODE tags.
29 Oct 2012 6:23 AM #3
I updated the attached file. Well-spotted, Mitchell. Thanks. Mea culpa.
9 Nov 2012 12:19 PM #4
Any chance you can get back to this one, please?
21 Nov 2012 12:13 PM #5
23 Jun 2013 10:12 PM #6
Subscribe to the issue, when it will be fixed?
Sencha Touch 2.2.0
Sencha Cmd v220.127.116.112
Still does not work
21 Aug 2013 10:04 PM #7
Any solution or work around found?
Ext.device.Connection does not work on native IOS after ST 2.0.1
26 Aug 2013 11:17 AM #8
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:
27 Nov 2013 3:02 AM #9
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
27 Nov 2013 6:40 AM #10