Capacitor routes won't change when building iOS applicaiton
-
When developing and testing my application using capacitor things work perfect, but when I use the build command I cannot get the application to change routes on the emulator or when pushed to TestFlight. Have I missed something? Has anyone else had this experience?
-
I am facing a similar problem on iOS with capacitor routing right now actually. I’m using router hash mode and on initial load the url is
capacitor://localhost#
instead ofcapacitor://localhost/#
. So there is no trailing slash initially which breaks things. Sometimes when I navigate around this gets corrected. I tried settingPUBLIC_PATH=capacitor://localhost/
but it doesn’t seem to work.Working on a fix now, but I think at least in my case it has to do with the trailing slash
-
@g_hult Thank you very much for this! I will see what I can be done about it, but perhaps I may have to delay my release. I will tinker with it now with this is mind and let you know if I uncover anything. Thanks again!
-
-
@dobbel Done!
-
I made a workaround / hack for now on iOS with this line on my initial page.
created(){ if(this.$q.platform.is.ios){ this.window.location = "capacitor://localhost/#/" } }
At least that solves the urgent issue for now and sets the trailing slash correctly to “/#/” for all subsequent navigations.