... but when I do this on the model page in chrome, it just reloads the page
I assume that you mean that you just go into Chrome and type https://example.com in the browser bar.
Unfortunately, the Linking application will not work if you enter the URL into the browser panel. This may seem disappointing, but there is a good reason why this should not work. According to Paul Kinlan, Google Dev Advocate explains that this will be a bad user interface:
If the user enters the URL into the address bar of the system, the intention of the user is to visit the page in question. We do not believe that the user intended to go to the application. Ergo, redirecting the user of the application does not work well.
link
This answer only applies to entering the URL into the Chrome URL bar . But the same (mostly) is true if the user clicks a link on a web page . Let us know why everything doesnβt work with each of your links to examples. I'll start in the middle:
<a href="https://www.EXAMPLE.com/">Click HERE for url with slash</a>
<a href="https://www.EXAMPLE.com">Click HERE for url, no slash</a>
For these links to launch your application, Chrome must send the intent to the system using action.VIEW , category.DEFAULT **, category.BROWSABLE and a scheme of either http or https . You can create an intent filter that catches this intent (your app attachment intent filter will work):
<intent-filter android:autoVerify="true"> <action android:name="android.intent.action.VIEW"/> <category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.BROWSABLE"/> <data android:scheme="http"/> <data android:scheme="https"/> <data android:host="www.example.com"/> </intent-filter>
If you check the logs (or just check them as is), you can see that Chrome does not smooth out the intent. They prefer to handle this link internally (by going to a new page). This is a feature of Chrome, not Android. Unable to change this. However, you can specify a custom scheme in the URL that Chrome will abide by. This leads me to your first url:
<a href="EXAMPLE://">Click HERE for schema</a>
Chrome will respect the scheme in this URL and dismiss the intent: action.VIEW , category.DEFAULT **, category.BROWSABLE and the EXAMPLE scheme. Depending on how you have your intent filter settings, this will launch your application. Your first impulse might be to add an EXAMPLE schema to your application intent filter:
<intent-filter android:autoVerify="true"> <action android:name="android.intent.action.VIEW"/> <category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.BROWSABLE"/> <data android:scheme="http"/> <data android:scheme="https"/> <data android:scheme="EXAMPLE"/> <data android:host="www.example.com"/> </intent-filter>
This will allow you to click the link in Chrome and open Chrome for Chrome. However, it will break the connection with applications . The pro solution is to leave the app join intent filter unchanged and add a second intent filter to catch your own scheme:
<intent-filter> <action android:name="android.intent.action.VIEW"/> <category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.BROWSABLE"/> <data android:scheme="EXAMPLE"/> <data android:host="www.example.com"/> </intent-filter> <intent-filter android:autoVerify="true"> <action android:name="android.intent.action.VIEW"/> <category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.BROWSABLE"/> <data android:scheme="http"/> <data android:scheme="https"/> <data android:host="www.example.com"/> </intent-filter>
This is probably TMI, but going to the root helps to understand why everything works / does not work.
** Remember that the system will add category.DEFAULT to any implicit intent.
==============================================>
UPDATE: I have to add that using your own schema is bad practice. The absolutely best approach is documented here.