-
12 Aug 2012 9:27 PM #1
OnlineManager for Sencha Touch
OnlineManager for Sencha Touch
Useful utility for detection of the online status, and something else
Initial release on GitHub: https://github.com/kostysh/Online-Ma...r-Sencha-Touch
Features:- Detection of the online status (real, not only connection)
- Events: exception, beforeonline, beforeoffline, onlinechange, online, offline
Code:OnlineManager.on({ 'onlinechange': function(mode) { if (mode) { console.log('We are online'); } else { console.log('We are offline'); } } }); OnlineManager.start();
-
13 Aug 2012 11:41 AM #2
Thank you for the contribution.
Scott.
-
14 Aug 2012 5:19 AM #3
Thanks kostysh!
I will try it out
Note: this requires the apps to be native to have access to device.Connection
-
15 Aug 2012 7:46 AM #4
-
15 Aug 2012 1:43 PM #5
If it isn't a native web-app, it wont have access to the libraries in Ext.device. I tried adding it to one of my web-apps and ran it in Chrome and it did not work.
-
15 Aug 2012 2:51 PM #6
but it works fine in my non-native app

look into official docs: http://docs.sencha.com/touch/2-0/#!/...ice.Connection
confirm that in Chrome (desktop) isOnline method works and uses navigator...Both the Sencha Packager and PhoneGap implementations will use the native functionality to determine if the current device is online. The Simulator version will simply use navigator.onLine.
-
16 Aug 2012 7:49 AM #7
You gave a local link
but I checked the docs. I am not using PhoneGap or Sencha Packager.
When I request navigator.onLine in the console, that works.
-
16 Aug 2012 8:18 AM #8
Ups. fixed.
I am not using PhoneGap at this time too. But some guys use.
The main thing that Ext.device.Connection will works without native (with less features) and without any errors. If you have problems with 'production' build of your app - this is completely different question.
-
16 Aug 2012 9:08 AM #9
I told ya I am not using an app. I was trying this with a web app (not native, no phonegap, no sencha command). Just a dynamic web project.
-
16 Aug 2012 9:09 AM #10
this is what I meant


Reply With Quote
