I write this post in sheer frustration with Ionic deeplinks, deeplinks plugins and configurations.
This is going to be a long(-ish) rant and a cry for help, but I believe this will be useful to everyone in the future if solved, as confusion around this subject is tremendous.

Yeah, sorry to the Ionic devs but your docs also don’t help there and if something, only aggravate the confusion.

Let’s try to make what I want to achieve clear and go from there.

So, I have an application that runs on the browser and also as a mobile application, being that the “primary” usage would be the app.

To run on the browser, I use the Hash Location Strategy (which is the default setting, even on ionic serve) as well as the Ionic 2 API Deeplinker to allow navigation directly to certain pages, which happens on https://app.mysite.com/#/login/:paramName style links (notice the hash).This works flawlessly.

Now, when on a mobile phone, I want to be able to have my app those same links, e.g., https://app.mysite.com or https://app.mysite.com/#/login/:paramName links rather than going to the browser.
To do that, I use the Ionic Native Deeplinks Plugin, which, as a bonus, also allows me to open myscheme://myapp style links (which I don’t really plan to use, but it’s there).But this is where the frustration starts.

The app does respond to http://app.mysite.com links without a issue, however, links with a hash (and then the path and parameters) ALWAYS fail to match.

I WANT and NEED to have this working. I’ve tried a bunch of different configurations but nothing seems to work.

I’ve read posts like this one (a search gets you more results) and opened 1 or 2 threads about it.
Also on the Native Plugin Github issues, like this one, this one or this other one.
It goes without saying that I’ve read the Android (1, 2) and iOS docs on Universal App Links. I’ve read the blog posts about it. Still nothing

Now, as for my configurations:
The Ionic API Deeplink in app.module.ts:

Yes, I’ve noticed I’m not including an ANDROID_PATH_PREFIX. I’m pretty sure I don’t need it but if you can convince me otherwise, I will.

Another thing that p***** me off is that, not matter what I do, my AndroidManifest.xml always ends up with stupid stuff that I didn’t ask to get in there related to the plugins, namely, adding 5 hosts and the ANDROID_PATH_PREFIX which I explicitly told it to remove, and if I edit it manually, the next build is going to add even more junk to the file (notice the “repeated” intent-filter):

So, what gives? How the hell are we supposed to handle this sort of behaviour? Wasn’t it all supposed to work without conflicts?
I need some help here folks.

Sorry for the long post.

EDIT:

So, I eventually went ahead and debugged the deeplinks plugin code and found out that when we are passing a hash in the url, the first character on the match path will be removed. This provided me with a solution. When I went over to github to file an issue I eventually found this post with an exact description of the issue and the same solution I came to found. Since github doesn’t look for the # symbol this never came up in the search results.

For anyone troubled by the same issue the solution is to remove the first forward slash from the deeplinks routes, like this:

I just don’t think Deeplink is ready for prime time. If you do a search on this forum or on GitHub, there are a lot of weird issues. Hopefully someone will come along and prove me wrong, but I’ve seen a lot of frustration and few solutions. It seems to me that we’re still a couple steps away from Ionic being a desktop framework, and the issues with the Deeplinker are one reason I say that.

That is actually a very good question, but I believe you might away with just using IP address, as long as everything is properly configured a the json files are served from within the expected address, namely:

Well, I don’t know how you are exposing your IP address “to the world”, but assuming a scenario where you are hosting your API/Server under a publicly accessible IP address, I see one issue with your configuration:

The rest you can leave as is. Now, this is talking about using URLs to open you application directly. Please also note the following: Ionic usually adds a # when open on the browser (ionic serve for instance).If you want to have the app open in reply to those kinds of URLs, you are gonna have to drop the forward-slash on the deeplink paths, namely, /h becomes h and /p/4 becomes p/4.

(Actually, disregard this statement, that function does deal with deeplinks)
Then, I believe that the deeplink function you are using does NOT deal with Universal App Links (also called deeplinks) but I’m not sure of that because you don’t list which import you are using to refer to deeplinks.(Go check the docs on DeepLinkConfig [ionic-angular package] and Deeplinks [ionic-native]). Configuration is similar but they are for different purposes.

Finally, I’ve come to notice of when my implementation that routeWithNavController() doesn’t really work. Why? I don’t know but I’ve had much better results using route(routes).subscribe() where routes is a JSON object: