Use different hostname than localhost

I have a ionic app, using cordova. I want to change the hostname from localhost to something like ‘myapp.local’

In the documentation of cordova I saw you could add a tags called ‘hostname’ and ‘scheme’ to the config.xml file and it will use this.

I’ve tried this in my ionic app, and when inspecting with the chrome device inspector, I can see the hostname is changed:
image

But even though the path in the devtools says ‘myapp.local/login’ it doesn’t go past the splash screen.
Is there something I need to do in ionic to make this work?
I don’t get any errors in the devtools console only some warnings;

you most likely need to add an allow-navigation tag to allow navigation to the new hostname, at least if using cordova-plugin-ionic-webview

1 Like