Closed igorsantos07 closed 2 months ago
It's not programmatically possible to natively restart a Cordova app on iOS in the same way as for Android. While some pseudo-restart behaviour is suggested in this SO post, in a Cordova app this won't work because the app delegate functions that Cordova uses as hooks to bootstrap itself will not be fired again, so you'd have to rewrite part of the Cordova iOS platform code to try to make it work.
If you just want to reset the state of the JS layer, you could use window.location.reload()
to reload the Cordova webapp in the Webview.
Feature request
The Android-only feature of
restart()
could be very useful for my project, but we would need it to work on iOS as well. I haven't researched alternative solutions so far - in fact, I stumbled upon this idea while looking for permission solutions. But I'm wondering: is there any chance the restart could be implemented on iOS as well, or there's a technical reason it wouldn't ever work?