【问题标题】:Android: Deep linking web urlsAndroid:深层链接网址
【发布时间】:2017-03-08 22:12:09
【问题描述】:

我想在 Android 中集成 web-url 的深层链接。但是,我无法让它工作。以下是我正在遵循的步骤:

步骤 1.AndroidManifest.xml:

<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="niksguitarist.000webhostapp.com" android:pathPrefix="/asset"/>
</intent-filter>

<meta-data android:name="asset_statements" android:resource="@string/asset_statements" android:autoVerify="true"/>

步骤 2. res/values/strings.xml:

<string name="asset_statements">
   [{
   \"relation\": [\"delegate_permission/common.share_location\"],
   \"target\": {
   \"namespace\": \"web\",
   \"site\": \"https://niksguitarist.000webhostapp.com/\"
   }
   }]
</string>

第 3 步。在服务器上托管assetLinks:

https://niksguitarist.000webhostapp.com/.well-known/assetlinks.json

[{
  "relation": ["delegate_permission/common.handle_all_urls"],
  "target": {
    "namespace": "android_app",
    "package_name": "com.sprinklr.distributedapp",
    "sha256_cert_fingerprints": ["A8:D4:5F:DC:AE:67:D6:90:46:23:07:8B:23:89:0B:11:AB:49:4E:B0:C7:87:50:0C:59:32:01:A0:4A:88:1A:5A"]
  }
}]

现在,当我尝试在移动浏览器(chrome 或 firefox)上打开 https://niksguitarist.000webhostapp.com/asset 时,它不会将我路由到我的应用程序。

有人可以建议我做错了什么吗?

【问题讨论】:

    标签: android deep-linking


    【解决方案1】:

    如果您尝试直接从浏览器打开 url,应用链接将不起作用。仅当您尝试从非浏览器应用程序打开 url 时它才有效 - 笔记、聊天或任何其他应用程序

    【讨论】:

    • 或来自另一个域(在网络浏览器中)
    猜你喜欢
    • 2011-06-21
    • 1970-01-01
    • 2013-05-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-07-18
    • 1970-01-01
    相关资源
    最近更新 更多