android - 您可以在运行时注册 url Intent 吗?

标签 android android-intent xamarin.ios xamarin.android xamarin.forms

我想做的是允许用户定义要使用应用程序处理的 url 域。

因此,如果用户输入“https://www.mydomain.com”,应用程序应处理与该域的所有链接。它还可能需要处理多个 url。

首先,这可能吗?其次,如何实现?我正在使用表单,但显然我可以在特定于平台的项目中执行此操作。

此外,这在 Android 以外的平台上是否可行?

最后,作为后备方案,这可以作为应用 list 或代码中的通配符“*.somedomain.com”来完成吗?

最佳答案

由于 url 处理程序是在 list 中定义的,因此这是不可能的。您无法为 wildcard subdomains 添加处理程序:

The Digital Asset Links protocol treats subdomains as unique, separate hosts. If your intent filter lists both the www.example.com and mobile.example.com subdomains as hosts, you must host a separate assetlink.json file on each subdomain. For example, an app with the following intent filter declaration would pass verification only if the website owner published valid assetlinks.json files at both https://www.example.com/.well-known/assetlinks.json and https://mobile.example.com/.well-known/assetlinks.json

关于android - 您可以在运行时注册 url Intent 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41199230/

相关文章:

ios - Xamarin IOS LaunchScreen.Storyboard 无法为 ImageView 选择图像

Android - 开始新 Activity 时保存 Activity 状态

android - 我怎样才能实现 CoverFlow View

Android 通知重新排序到前面不起作用。从它工作过的APP复制过来的

c# - 在同一个项目中使用不同SDK版本的框架有什么影响?

c# - 如何在 monotouch Xamarin 中裁剪图像

java - MediaPlayer 中的 IllegalStateException#Pause

java - Android studio启动失败: Fatal error initializing 'null'

android - 从 ViewHolder(列表)中删除项目,更新屏幕

java - 在完成之前将数据从一项 Activity 发送到另一项 Activity