伙计们,我需要在 android 和 iOS 上逐步实现 Applink(通用链接),请任何人帮助实现这一点。我在我的android项目中尝试了以下代码
我按照这个 URL 写了这个 https://devblogs.microsoft.com/xamarin/connect-with-your-users-with-google-search-and-app-indexing/
注意我不需要索引概念只是想通过点击任何 URL 打开应用程序
首先我安装了 Xamarin.Forms.AppLinks NuGet
MainActivity 代码下方
[IntentFilter(new[] { Android.Content.Intent.ActionView },
Categories = new[]
{
Android.Content.Intent.CategoryDefault,
Android.Content.Intent.CategoryBrowsable
},
DataScheme = "http",
DataPathPrefix = "/",
DataHost = "test.com")]
- 然后在OnCreate方法中编写如下代码
AndroidAppLinks.Init(this);
- 然后我尝试从深层链接测试器调用深层链接 URL“test://DeeplinkingSample”
它说没有找到处理意图的事件
最佳答案
4.Then I try to call deeplink url "test://DeeplinkingSample" from Deep Link Tester
Its saying No Activity found to handle intent
您正在尝试调用 URL test://DeeplinkSample
,它包含以下部分
- 方案是
测试
- 宿主是
DeeplinkSample
- 没有数据路径
但是,您没有为该 URL 注册您的事件,而是为方案 http
,主机 test.com
和数据路径前缀 /
(即可能所有以 /
开头的数据路径)。因此,当您尝试打开应用时,该应用应该会打开
http://test.com/...
关于c# - 如何在 Xamarin forms Android 和 iOS 中实现 Deeplink(Universal Linking)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59926139/