Reputation: 682
I want to enable the deep linking to my app when click a URI having the following format:
http://abc-def?param=abc
Can it be achieved?
I've tried putting the following code in AndroidManifest.xml
<data android:scheme="http" android:host="abc-def"/>
I've tried also adding multiple regex in pathPattern but none of them worked.
Any help?
EDIT
Noting that with the solution above without any pathPattern, when clicking the URI without specifying any params, the deep linking works fine.
Upvotes: 1
Views: 546
Reputation: 1007399
The problem with http
-style app links is that not everyone handles them properly. For example, Chrome and Firefox (the last I checked, a few months ago) will not honor http
app links at all, preferring instead to handle those links internally by requesting the indicated Web page. While I was not aware of Gmail's problems with URLs containing queries, it doesn't completely surprise me, though it's a bit odd.
For places where you provide actual HTML with actual links, using a custom scheme (e.g., chrisapp://something
) may be more reliable. Browsers, for example, will realize that they have no idea how to handle the chrisapp
scheme and are more likely to try ACTION_VIEW
. However, in places where you are providing plain text (e.g., SMS), custom schemes are very unreliable, as it's unlikely that whoever presents the text will realize that this particular sequence of characters is something that should be clickable and open up an ACTION_VIEW
activity.
If there is a universal, rock-solid way of doing app links, I am not aware of it. :-(
Upvotes: 1