简体   繁体   English

适用于Android的AppLinks

[英]AppLinks for Android

when I click an applink,I need to chose the chrome or my app 当我点击applink时,我需要选择chrome或我的应用程序

在此输入图像描述

I Check my website Google Statement List Generator and Tester i got below 我查看我的网站Google Statement List Generator和Tester我得到了以下内容

Success! Host XXX grants app deep linking to XXX.

But adb shell dumpsys package domain-preferred-apps shows 但adb shell dumpsys包domain-preferred-apps显示

"Status: undefined"

Anyone knows how to fix it? 任何人都知道如何解决它?

Manifest.xml ` Manifest.xml`

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

            <data
                android:scheme="https"
                android:host="XXXX.XX"
                android:path="/test" />
        </intent-filter>`

the applinks status is not "always" how to make it right??? applinks状态不是“总是”如何使它正确???

"Status: undefined"

put this code on TextView onClick Listener.. 将此代码放在TextView onClick Listener上..

String urlString="http://www.google.com";
Intent intent=new Intent(Intent.ACTION_VIEW,Uri.parse(urlString));
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setPackage("com.android.chrome");
try {
context.startActivity(intent);
} catch (ActivityNotFoundException ex) {
// Chrome browser presumably not installed so allow user to choose instead
intent.setPackage(null);
context.startActivity(intent);

} }

To avoid seeing the chooser, you need to set up Verified App Links. 要避免看到选择器,您需要设置验证应用链接。 See here for instructions 请参阅此处获取说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM