如何在 IOS 中重启 Ionic 应用程序

How to restart Ionic app in IOS

我正在为 android 和 IOS 开发离子应用程序。如果服务器端或客户端发生任何错误,应用程序将被重新声明。我可以使用

为 android 开发它
navigator.app.loadUrl("file:///android_asset/www/index.html"

但是对于 IOS 我无法做到这一点。请让我知道 IOS.

的任何解决方案

我知道有 $state.go()windows.reload 但这对我不起作用,因为一些 AppHub.On 信号事件没有正确初始化。 只有一种解决方案对我有用,就像 android,但我无法对 IOS 做同样的事情。

我可以解决这个问题

var initialHref = window.location.href;
navigator.splashscreen.show();
// Reload original app url (ie your index.html file)
window.location = initialHref;
navigator.splashscreen.hide();