Android自定义URL,用于在iOS中打开App

MaF*_*aFt 30 html android ios

我可以在一个网站上添加一个链接,例如"navigon://",在iOS设备中,如果安装了Navigon应用程序,它将打开它.

是否有类似的简单方法从Android网站(假设已安装)打开应用程序?

Dea*_*on1 20

Android深层链接:为您的清单添加一个intent过滤器

<activity
android:name="com.example.android.GizmosActivity"
android:label="@string/title_gizmos" >
<intent-filter android:label="@string/filter_title_viewgizmos">
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.DEFAULT" />
    <category android:name="android.intent.category.BROWSABLE" />
    <!-- Accepts URIs that begin with "http://www.example.com/gizmos” -->
    <data android:scheme="http"
          android:host="www.example.com"
          android:pathPrefix="/gizmos" />
    <!-- note that the leading "/" is required for pathPrefix-->
    <!-- Accepts URIs that begin with "example://gizmos”
    <data android:scheme="example"
          android:host="gizmos" />
    -->
</intent-filter>
Run Code Online (Sandbox Code Playgroud)

https://developer.android.com/training/app-indexing/deep-linking.html


Ama*_*lam 6

查看Android中的意图过滤器.特别查看类别.

  • 谢谢,但这是指使用Android SDK编写应用程序.我需要一种从网页'a'链接打开应用程序的方法,例如,如果安装在iOS设备上,<a href="navigon://"> Open Navigon </a>将打开Navigon应用程序. (2认同)