Exclude rule not working in apple-app-site-association file for URLs containing `#` sign

67 Views Asked by At

I'm facing an issue with deep links in iOS. I have a URL that needs to be excluded, and it includes a # sign, for example, https://www.someurl.com/#/register.

I've tried excluding this path in the apple-app-site-association file using the following declarations:

{
  "/": "/#/register/*",
  "exclude": true
},
  "/": "/#/register/",
  "exclude": true
},
{
  "/": "/#/register",
  "exclude": true
}

Despite declaring the exclude rule in the association file, the deep link still opens the app from the web browser. If you've encountered a similar issue and found a solution, I would greatly appreciate it if you could share your experiences.

1

There are 1 best solutions below

0
Paulw11 On BEST ANSWER

In a url, everything following the # character is part of the fragment, not part of the path.

This means that you have to use the fragment matching rule, described here in your file.

You want something like

{
   "#": "/register",
   "exclude": true
}