I have an Ionic/Angular PWA for a project, which has a native (Ionic Cordova) app as well for mobile. On the app we need to accept deeplinks that will have the same URL as the PWA (so you can access from PC and from mobile using the same link).
For iOS deeplinks ("universal links" as they call them) to work, the TLD needs to provide some file called apple-app-site-association
(without extension), at the root folder or inside the .well-known
path. Same goes for Android, but with a file called assetlinks.json
(although in this case it is not really necessary for this to work, it is just there to comply with some Android guidelines).
The thing is, when I try to access the iOS file, my PWA opens up and catches it as a route and redirects to the home page. With the Android file it works well though, since it has an extension and Angular (or the hosting server) recognizes that the browser wants to access some static file.
I have looked this up throughout the internet and could not find any solution...
The website is hosted on an IIS server, and I have tried some settings fixes on the web.config
file such as rewriting the path to an identical file with a .json
extension and another one I do not seem to remember right now.
I did try all the combinations I could think of for the routes in the src/app-routing.module.ts
file as well. If there is a wildcard route it will be matched and redirected to wherever is specified. If not, I get an Error: Cannot match any routes. URL Segment: '.well-known/apple-app-site-association'
.