I just updated our app to ionic 3.5.0 and I saw that now the URL is rewritten in my desktop browser (for example /#/fv/home is automatically rewritten to /#/nav/n4/fv/home).
I’m not really happy with that “ugly” URL and I’d like to keep using my clean URLs. So I started to dig in documentation about navigation and deeplinks and I am now a bit confused.
In our current app, we are using the deepLinkConfig like described at the end of that page https://ionicframework.com/docs/api/IonicModule/.
IonicModule.forRoot(..., { mode: 'md' }, { links: [ { component: FvCachePage, name: 'Cache', segment: 'cache' }, { component: FvPage, name: 'fv', segment: 'fv/:fvL1' }, { component: FvPage, name: 'fv', segment: 'fv/:fvL1/:fvL2' }, { component: FvPage, name: 'fv', segment: 'fv/:fvL1/:fvL2/:fvL3' }, { component: FvPage, name: 'fv', segment: 'fv/:fvL1/:fvL2/:fvL3/:fvL4' }, { component: FvPage, name: 'fv', segment: 'fv/:fvL1/:fvL2/:fvL3/:fvL4/:fvL5' }, { component: FvPage, name: 'fv', segment: 'fv/:fvL1/:fvL2/:fvL3/:fvL4/:fvL5/:fvL6' }, { component: LoginPage, name: 'login', segment: 'login' }, { component: ResetPasswordPage, name: 'Reset password', segment: 'reset-password/:token', defaultHistory: [ 'login' ] }, { component: VersionPage, name: 'version', segment: 'version' }, ] })
This configuration allows us to manage dynamic links.
That deepLinkConfig property is not really documented and now it seems we can use the @Page decorator to define the segment for a page.
Does the @Page decorator support multisegments? Will that deepLinkConfig property be soon removed? What happens if we mix them?
Another question related to navigation, you can easily change the URL in your browser navigation bar. It means a user can easily try to access some URL that doesn’t match any defined segment in our app. How can we manage those “404” pages? Right now it is just showing some message cannot get /fjdhjfhdjfh.
And the last one: is the native deeplinks plugin related at some point with segments we defined in our app or it just manages its own links like indicated in the documentation?