Simple code to check for network connectivity
My event listener for my web view is below. I am aware that you need to have an alert for network connectivity when submitting to Apple. I am having a bit of trouble and am looking for a simple way to check for connectivity. Any suggestions?
if (e.rowData.url)
{
var webview = Titanium.UI.createWebView({
url:e.rowData.url
});
win.add(webview);
win.showNavBar();
win.barColor = '#012F03';
}
the whole code is below. thanks in advance
http://pastie.org/1056411
5 Answers
-
// not online
if (Titanium.Network.networkType == Titanium.Network.NETWORK_NONE)
-
Try this out: Titanium.Network.online
-
if(!Titanium.Network.online){ //alert user about internet }
That's a way of checking
-
i tried both of your suggestions, no luck.
-
Daniel, where would I insert this code?
In the event listener?