I am developing an ionic app for android and IOS. If any error occurred from server side or from client side the app gets restated. I am able to develop it for android using
navigator.app.loadUrl("file:///android_asset/www/index.html");
but for IOS I am not able to do this. Please let me know any solution for IOS.
I know there is $state.go()
or windows.reload
but this not worked for me because the some AppHub.On signals event are not initialize properly. Just only one solution will work for me just like android, but I am not able to do this same for IOS.
you can try
$location.path(url);
But $location.path() does not reload the page, if you do want a reload, you have to use $window.location.href or window.location.reload()
here I am passing ripple url but its still not redirecting to login page
$location.path(“http://localhost:8100/#/login”);
window.location.reload();
I want to be redirectd it to index.html page
try
$location.path(’/login’);
I want to be redirectd it to index.html page
its not working $location.path(’’) showing me the same page. not going on index.html page
How about this:
window.location.href = “file:///android_asset/www/index.html”;
$ionicHistory.nextViewOptions({
disableAnimate: true,
disableBack: true,
historyRoot: true
});
It should work in iOS as long as you do the state changes from indexCtrl and make urlrouter.otherwise("/");( PS: I have never done that )
I solve this issue using.
var initialHref = window.location.href;
navigator.splashscreen.show();
// Reload original app url (ie your index.html file)
window.location = initialHref;
navigator.splashscreen.hide();
thanks for your replys
Just out of curiousity, does navigator.splashscreen.show(); clear the view cache as your intent is to restart the app, i believe you should clear the history.