Reputation: 4550
I am trying to implement deep linking in my app. That is, when a user goes to my website, it should open the app.
I feel like I am missing something small to get this to finally work but I don't know what. Below my description I'll attach screenshots of everything I mention.
To test if it works, I've created a webpage with two links on it. One link links to the Application ID (which in my case is "il.co.lilo.journal_app_v2") so the link is: https://il.co.lilo.journal_app_v2/bubu/1. When clicking on it, the app opens and I handle the event in the MainActivity.cs file, in the OnCreate event. So that works (though when you go back to the browser it shows an ugly 'Site can't be reached' error).
The other link, links to my website "https://lilo.co.il/bubu/1". Clicking on this link simply goes to the website without opening the app and this is what I need help with.
I've created the assetlinks.json and it exists at https://lilo.co.il/.well-known/assetlinks.json
For testing I created an APK using the keystore file I used for the assetlinks.json file and installed on my phone.
My MainActivity.cs file has the following Intent Filters:
[IntentFilter(new[] { Android.Content.Intent.ActionView },
DataScheme = "http",
DataHost = "lilo.co.il",
DataPathPrefix = "/bubu",
AutoVerify = true,
Categories = new[] { Android.Content.Intent.ActionView, Android.Content.Intent.CategoryDefault, Android.Content.Intent.CategoryBrowsable })]
[IntentFilter(new[] { Android.Content.Intent.ActionView },
DataScheme = "https",
DataHost = "lilo.co.il",
DataPathPrefix = "/bubu",
AutoVerify = true,
Categories = new[] { Android.Content.Intent.ActionView, Android.Content.Intent.CategoryDefault, Android.Content.Intent.CategoryBrowsable })]
[IntentFilter(new[] { Android.Content.Intent.ActionView },
DataScheme = "http",
DataHost = "il.co.lilo.journal_app_v2",
DataPathPrefix = "/bubu",
AutoVerify = true,
Categories = new[] { Android.Content.Intent.ActionView, Android.Content.Intent.CategoryDefault, Android.Content.Intent.CategoryBrowsable })]
[IntentFilter(new[] { Android.Content.Intent.ActionView },
DataScheme = "https",
DataHost = "il.co.lilo.journal_app_v2",
DataPathPrefix = "/bubu",
AutoVerify = true,
Categories = new[] { Android.Content.Intent.ActionView, Android.Content.Intent.CategoryDefault, Android.Content.Intent.CategoryBrowsable })]
The HTML for the page I created to test is:
<a href="https://il.co.lilo.journal_app_v2/bubu/1">https://il.co.lilo.journal_app_v2/bubu/1</a><br>
<a href="https://lilo.co.il/bubu/1">https://lilo.co.il/bubu/1</a><br>
When clicking on the top link (https://il.co.lilo.journal_app_v2/bubu/1) my app opens great but when I go back to the browser, I see this which is not good:
When I click the second link, as I said before, it simply goes to the website even though when I look at my apps "Supported web addresses" in the App Info:
I can see it shows my site URL:
Upvotes: 1
Views: 1546
Reputation: 4550
Okay, So I finally got it to work.
The following steps are what I did to get it working (please correct me if there is an easier way)
Upvotes: 1