深层链接在Android中不再起作用

问题描述 投票:0回答:1

我已经在Android Studio中启动了一个新项目,并将其添加到我的androidmanifest.xml

    <activity android:name=".MainActivity">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>

        <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.example.com"
                android:pathPrefix="/gizmos"
                android:scheme="http"/>
        </intent-filter>
    </activity>

然后我去了Google Chrome浏览器并输入:http://www.example.com/gizmos。该应用程序无法打开。然后尝试命令行:

mac-van-jim:DeeplinkTest jimclermonts$ adb shell am start -n eu.theappfactory.deeplinktest/MainActivity
Starting: Intent { cmp=eu.theappfactory.deeplinktest/MainActivity }
Error type 3
Error: Activity class {eu.theappfactory.deeplinktest/MainActivity} does not exist.

还有这个:

mac-van-jim:DeeplinkTest jimclermonts$ adb shell am start -W -a android.intent.action.VIEW -d "http://www.example.com" eu.theappfactory
Starting: Intent { act=android.intent.action.VIEW dat=http://www.example.com/... pkg=eu.theappfactory }
Error: Activity not started, unable to resolve Intent { act=android.intent.action.VIEW dat=http://www.example.com/... flg=0x10000000 pkg=eu.theappfactory }

我已经尝试过这些线程:

Deep Link does not work on Android

Android deep linking is not working

Deep-linking intent does not work

没有任何作用吗?我记得这个曾经工作吗?也许是因为有了新的Android应用程序链接?

编辑:我发现它在Chrome中不再可用(但是),但是在创建和上传网页时,它也不起作用:

<!DOCTYPE html>
<html>
<head>

<body>

    <a href="Click here" target="_blank">http://www.example.com/gizmos</a>

</body>

</head>

</html>
android uri deep-linking
1个回答
0
投票
© www.soinside.com 2019 - 2024. All rights reserved.