深度链接在 android 中不起作用。我在这里粘贴了我的 list 代码。当我测试时,它会进入网站,而不是在我的应用程序中打开我的 Activity 。有人可以帮我解决这个问题吗?
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.clinicloud.app" >
<application
android:name=".MainApp"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar" >
<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:host="www.XXXX.com"
android:pathPrefix="/xyz"
android:scheme="http"/>
</intent-filter>
</activity>
<activity
android:name=".OnboardingActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".ProfileViewActivity"
android:label="@string/title_activity_profile_view"
android:theme="@style/AppTheme.NoActionBar" >
</activity>
</application>
</manifest>
更新:
adb shell am start -W -a android.intent.action.VIEW -d " http://www.clinicloud.com/xyz"com.clinicloud.app
使用 adb 进行测试会打开应用程序,但仅使用浏览器不会打开应用程序。
请您参考如下方法:
就是这样烦人通过 测试深层链接亚行正如 Android 开发团队建议的那样。我们不会得到我认为的问题的要点。 我们想要一个直接的方法就像在已经安装了该应用程序的同一设备中粘贴一个指向浏览器的链接,点击 GO,然后应用程序就会出现。但不幸的是,它不会工作。
原因:
这不是一个纯链接,当您转到浏览器的 URL 搜索时,它实际上会执行不同的 URL,例如:“https://www.google.com/search?....”
解决方案:打开一个纯链接
2.1。您可以使用链接构建自己的简单网页(简单文件 *.html),然后单击它以打开纯链接。这是网页的示例:
<html>
<h1>
<a id="deeplink" href="ss.wohui.learn://subscribed">Deep Link</a>
</h1>
</html>
2.2.替换
ss.wohui.learn://subscribed
你的深层链接是什么。
2.3.将文件下载到您的设备。
2.4.用浏览器打开。
2.5.点击深层链接。
2.6.该应用程序将启动。