【问题标题】:Deeplink didn't work properly深层链接无法正常工作
【发布时间】:2018-11-17 12:59:02
【问题描述】:

创建一个深度链接表单 android studio,我将assetlinks.json 文件上传到主机上的 .well-known 文件夹中。

在 android studio 深度链接构建工具上一切正常,但是当我点击我网站中的链接时,它不会打开应用程序。 我的深层链接配置是这样的:

<activity
       android:name=".activities.OrdersActivity"
       android:screenOrientation="portrait">
       <tools:validation testUrl="https://myhost.com/cart/success" />

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

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

           <data
               android:scheme="https"
               android:host="myhost.com"
               android:pathPrefix="/cart/success" />
       </intent-filter>
   </activity>

我试过的网址是这个

https://myhost.com/cart/success?Authority=000000000000000000000000000000074139&Status=OK

【问题讨论】:

    标签: php android python web deep-linking


    【解决方案1】:

    您的代码看起来不错。您在哪个应用程序中点击了链接?他们可能会阻止深层链接并使用custom tabs library 在他们的应用中打开它们?

    您可以通过执行下面的 adb shell 命令来尝试您的深层链接:

    am start -a android.intent.action.VIEW -d "https://myhost.com/cart/success?Authority=000000000000000000000000000000074139&Status=OK"
    

    您无需将assetlinks.json 文件上传到您的.wellknown 文件夹即可实现深度链接。它是应用链接所必需的。应用链接和深度链接之间的区别在于,深度链接需要用户批准才能启动您的应用,而应用链接会自动执行。

    更详细的解释请看下面的文章

    https://developer.android.com/training/app-links/

    【讨论】:

    • 我在 Android 版 Chrome 中打开我的链接,但它只是重新加载并在我的网站中打开一个页面
    猜你喜欢
    • 2016-11-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-12-27
    • 2014-12-26
    • 1970-01-01
    相关资源
    最近更新 更多