【问题标题】:Ionic cordova network information plugin not working in ios离子科尔多瓦网络信息插件在ios中不起作用
【发布时间】:2016-09-30 16:50:07
【问题描述】:

我已经安装了cordova-plugin-network-information typing:

cordova plugin add cordova-plugin-network-information

另外,我在 index.html 中添加了 ng-cordova.min.js。该插件在 android 中运行良好,使用:

if(navigator.connection.type == "none"){
        $ionicLoading.hide()
        $ionicPopup.alert({
            title: "Internet Disconnected",
            content: "There is no internet connection. Please check the connection and try again."
        })
        .then(function(result) {
            ionic.Platform.exitApp();
        });
    }

但在 ios 中(通过 ionic emulate ios)应用程序甚至无法加载。有什么想法吗?

【问题讨论】:

  • 尝试发布错误跟踪。否则尝试在 ios 设备上安装应用程序并在 safari 中检查任何控制台错误跟踪

标签: javascript cordova ionic-framework


【解决方案1】:

您应该尝试这些步骤。也许您的插件没有在项目的根目录中更新

cordova plugin remove cordova-plugin-network-information
cordova plugin add cordova-plugin-network-information
cordova build.
ionic run ios

也许这会对你有所帮助:)

【讨论】:

  • 好吧,我把 Android 写成平台是我的错……你试过了吗?
猜你喜欢
  • 2017-11-04
  • 2018-07-28
  • 1970-01-01
  • 1970-01-01
  • 2016-08-30
  • 2017-09-20
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多