How to Implement Deeplink(Universal Linking) In Xamarin forms Both Android and iOS?

南笙酒味 提交于 2020-05-23 10:54:07

问题


Guys, I need to implement Applink (Universal Link) step by step both android and iOS, please any to help achieve this. I tried the following code in my android project

I followed this URL to write this https://devblogs.microsoft.com/xamarin/connect-with-your-users-with-google-search-and-app-indexing/

Note I no need to indexing concept just want to open the app from Clicking of any URL

  1. First I Installed Xamarin.Forms.AppLinks NuGet

  2. Below code MainActivity

[IntentFilter(new[] { Android.Content.Intent.ActionView },
        Categories = new[]
        {
            Android.Content.Intent.CategoryDefault,
            Android.Content.Intent.CategoryBrowsable
        },
        DataScheme = "http",
        DataPathPrefix = "/",
        DataHost = "test.com")]
  1. Then write bellow code in OnCreate Method
  AndroidAppLinks.Init(this);
  1. Then I try to call deeplink URL "test://DeeplinkingSample" from Deep Link Tester

Its saying No Activity found to handle the intent


回答1:


4.Then I try to call deeplink url "test://DeeplinkingSample" from Deep Link Tester

Its saying No Activity found to handle intent

You are trying to call the URL test://DeeplinkSample, which has the following parts

  • Scheme is test
  • Host is DeeplinkSample
  • No data path

However, you did not register your activity for that URL, but for the scheme http, with the host test.com and the data path prefix / (i.e. presumably all data paths that start with /). Hence the app should open when you are trying to open

http://test.com/...


来源:https://stackoverflow.com/questions/59926139/how-to-implement-deeplinkuniversal-linking-in-xamarin-forms-both-android-and-i

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!