Android 深度链接 – 支持的网址

huangapple go评论71阅读模式
英文:

Android Deep link- Supported web addresses

问题

我已经在Android中实现了深度链接,带有支持的网址,但是,

在应用程序中,默认情况下未启用,我不知道原因,我应该去应用程序设置中手动启用它,以便像这样开始工作:

Android 深度链接 – 支持的网址

我的问题是如何在安装应用程序时默认启用它?

我的清单:

<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="http" />
    <data android:scheme="https" />
    <data android:host="winwinapp.net" />
</intent-filter>
英文:

I've implemented an Android deep link with a support web address but,

It's not enabled by default in the app and I don't know the reason, I should go to the app setting and enable it manually to start working as shown here:

Android 深度链接 – 支持的网址.

My question is how to enable it by default when installing the app?

My Manifest:

&lt;intent-filter android:autoVerify=&quot;true&quot;&gt;
            &lt;action android:name=&quot;android.intent.action.VIEW&quot; /&gt;
            &lt;category android:name=&quot;android.intent.category.DEFAULT&quot; /&gt;
            &lt;category android:name=&quot;android.intent.category.BROWSABLE&quot; /&gt;
            &lt;data android:scheme=&quot;http&quot; /&gt;
            &lt;data android:scheme=&quot;https&quot; /&gt;
            &lt;data android:host=&quot;winwinapp.net&quot; /&gt;
        &lt;/intent-filter&gt;

答案1

得分: 3

这将仅在域名正确配置的情况下默认启用。文档在此处:https://developer.android.com/training/app-links/verify-android-applinks。

总结:

  1. https://winwinapp.net/.well-known/assetlinks.json 上传到您的服务器。(文档中提供了示例格式)
  2. 向您的应用程序添加 scheme。
  3. 确保将 android:autoVerify=&quot;true&quot; 设置为您的链接。

这样做是为了防止应用程序劫持深度链接。例如,防止恶意开发人员将 facebook.com 注册到他们的应用程序而不是官方应用程序。

英文:

This will only be enabled by default if the domain is configured properly. Documentation here: https://developer.android.com/training/app-links/verify-android-applinks.

Summary:

  1. Upload https://winwinapp.net/.well-known/assetlinks.json to your server. (Example format in the documentation)
  2. Add scheme to your app
  3. Make sure you set android:autoVerify=&quot;true&quot; to your link.

This is done to prevent apps from hijacking deeplinks. For example, to prevent a malicious developer from registering facebook.com to go to their app instead of the official one.

答案2

得分: 1

确保您的应用程序处于发布变体版本中。此外,请确保将assetlinks.json文件发送到正确的地址。

android:autoVerify=&quot;true&quot;

将自动提供选择。

英文:

Make sure your app is in the release variant-version. Additionally, make sure that the assetlinks.json file is sent to the correct address.

android:autoVerify=&quot;true&quot; 

will automatically provide selection.

答案3

得分: -1

确保在开发中向Firebase添加SHA1。另外,请确保在生产中从Play控制台向Firebase添加SHA1

英文:

Make sure add SHA1 to firebase for development. Other thing, make sure add SHA1 from play console to Firebase for production.

huangapple
  • 本文由 发表于 2023年7月23日 18:43:38
  • 转载请务必保留本文链接:https://go.coder-hub.com/76747805.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定