简体   繁体   English

通过浏览器打开Android应用(如果已安装应用),否则打开playstore

[英]Open Android app through browser if app is installed else open playstore

I have an app-url which opens app if installed and a playstore url which list my app on playstore 我有一个应用程序网址(如果已安装)会打开应用程序,还有一个Playstore网址,该网址会在Playstore上列出我的应用程序

app-url is like custom:// app-url就像custom://
and playstore url is like market:// 而playstore网址就像market://

I have to make a button in my webpage which onclicking opens app if installed otherwise open playstore. 我必须在网页上创建一个按钮,如果已安装,则onclicking会打开应用程序,否则打开playstore。
I know there is no way in Android to detect whether the mobile has app installed or not through javascript calls. 我知道Android中无法通过javascript调用来检测移动设备是否已安装应用程序。
Currently I am using intent url which does the same that i require but it does that only for chrome v 25+. 目前,我正在使用意图网址,该网址的功能与我所需的功能相同,但仅适用于chrome v 25+。
I want to do it for all browsers. 我想对所有浏览器都这样做。
I have tried using frames and timeout but it shows a pop-up in firefox that "couldn't find an application to open the link" 我尝试使用帧和超时,但是它显示了Firefox中的弹出窗口,“找不到用于打开链接的应用程序”
What should be stable and correct way to do it for all browsers? 对于所有浏览器,应该采用哪种稳定,正确的方法来做到这一点?

You can specify an intentfilter in the manifest file to open URL in your application. 您可以在清单文件中指定一个intentfilter,以在应用程序中打开URL。

Example is given below. 示例如下。

<intent-filter>
      <action android:name="android.intent.action.VIEW" />

      <category android:name="android.intent.category.DEFAULT" />
      <category android:name="android.intent.category.BROWSABLE" />

      <data android:scheme="http" />
      <data android:scheme="https" />
</intent-filter>

This url you could fetch from your activity using intent. 您可以使用intent从活动中获取此网址。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如果已安装则打开应用程序,否则发送下载-Javascript - Open app if installed else send to download - Javascript 无法通过javascript在Android Playstore中打开应用程序链接 - Cant open app link in android playstore from javascript 如果从我的网站在浏览器中安装了其他应用程序,如何在移动应用程序中打开共享对话框? - How to open share dialog in mobile app if installed else in browser from my website? 如果通过Safari中的网页安装,如何打开应用程序? - How to open an app if installed through a webpage in Safari? 如果已安装,则通过深层链接打开 Android 应用程序,如果未安装,则退回到网络 - Open Android app through deep link if it's installed or fall back to web if not installed Javascript 从浏览器检查应用程序是否已安装或打开应用程序(ios) - Javascript to check from browser if app is installed or open app (ios) 在本机反应中打开 Android 手机上已安装的应用程序 - Open installed app on android phone in react native 从应用程序打开单独的浏览器(ios / android) - Open a separate browser from an app(ios/android) 如果通过移动浏览器安装,则使用Facebook App打开粉丝页面 - Open a fanpage using Facebook App if installed via mobile browser 深度链接同时打开android和playstore网址上已安装的应用 - Deep linking opening both installed app on the android and playstore url
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM