通过模式强制打开android应用 [英] force open android app through schema

查看:223
本文介绍了通过模式强制打开android应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的故事。我有一个共享我的网站链接的android应用。在Android设备上,我想检查用户是否有我的android应用程序打开android应用程序并显示该链接的相应内容,但是如果没有让我的应用程序在浏览器中打开该链接。我为此使用 DeepLinkDispatch ,但是当用户单击共享链接时,android出现了问题选择哪个应用程序打开此链接(包括我的应用程序),但我想强制打开我的应用程序。 (如果安装在设备上)

Here is my story. I have an android app that shares my website link. on Android devices I want to check if the user has my android app open android application and show corresponding content to that link, but if do not have my app open up that link in the browser. I use DeepLinkDispatch for this, but I have a problem, when user click on shared link, android ask client to choose which app open this link (include my app), but i want to force open my app. (if installed on device)

推荐答案

在Android 6.0之前是不可能的。

That is not possible prior to Android 6.0.

在Android 6.0及更高版本上,您可以使用自动验证应用程序链接,以要求您的应用程序在 ACTION_VIEW Intents中使用时,应作为处理某些URL的应用程序 code>。

On Android 6.0+, you can can use automatic verification of app links to request that your app be the one to handle certain URLs, when they are used in ACTION_VIEW Intents.

但是


  • A网站浏览器不必使用 ACTION_VIEW 作为URL。欢迎使用Web浏览器来加载URL标识的网页。

  • A Web browser does not have to use ACTION_VIEW for a URL. A Web browser is welcome to just load the Web page identified by the URL.

我不知道应用链接验证是否可用于 ACTION_VIEW 以外的意图操作。您的问题是建议在 ACTION_SEND 中使用该URL。

I do not know if app link verification works for Intent actions other than ACTION_VIEW. Your question suggests that the URL might be used in ACTION_SEND instead.

用户可以进入设置并阻止您的应用处理网址。

Users can go into Settings and prevent your app from handling URLs.

这篇关于通过模式强制打开android应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆