0
我已经安装cordova-plugin-network-information使用CLI进行离子项目。我可以看到该插件在android.json文件在项目的根文件夹中,也在cordova_plugin.js在android平台文件夹中。科尔多瓦插件网络信息未按预期工作
cordova_plugin.js:
{
"id": "cordova-plugin-network-information.network",
"file": "plugins/cordova-plugin-network-information/www/network.js",
"pluginId": "cordova-plugin-network-information",
"clobbers": [
"navigator.connection",
"navigator.network.connection"
]
}
android.json:
"cordova-plugin-network-information": {
"PACKAGE_NAME": "com.ionicframework.fts1243245"
}
我打过电话window.Connection离子作为准备:
$ionicPlatform.ready(function() {
if(window.Connection){
if(navigator.connection.type == Connection.NONE){
$ionicPopup.confirm({
title:"Internet Disconnected",
content:"The internet is disconnected on your device."
})
.then(function(result){
if(!result){
ionic.Platform.exitApp();
}else{
ionic.Platform.exitApp();
}
});
}
}
}
但是,窗口。连接返回undefined
任何人都可以请让我知道出了什么问题吗?
感谢您的回复,我会检查并更新你,Actully我用我以前的应用程序相同的代码一切工作正常,我以前没有使用deviceRedy() – Selva