/****
* 当前的连接状态
*/
var networkState = $cordovaNetwork.getNetwork();
if(networkState == Connection.NONE){
alert('没有网络连接');
} else if(Connection.CELL_2G == networkState || Connection.CELL_3G == networkState || Connection.CELL_4G == networkState){
alert('使用流量连接');
} else if(Connection.WIFI == networkState){
alert('使用wifi连接');
} else if(Connection.ETHERNET == networkState){
alert('使用以太网');
}
网友评论