android - 创建 flutter 的深层链接时显示此错误

标签 android flutter deep-linking

我已经在 flutter app -> android -> src -> main -> androidmanifest.xml 中添加了此代码,但现在仍在工作

<!-- Intent filter for handling deep links -->
<intent-filter>
    <action android:name="android.intent.action.VIEW" />

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

    <!-- Accepts URIs that begin with "https://www.example.com/gizmos" -->
    <data
        android:scheme="https"
        android:host="www.example.com"
        android:pathPrefix="/gizmos" />
</intent-filter>

添加后仍然不起作用

最佳答案

确保 Intent 过滤器放置在您要处理深层链接的标记内。它应该嵌套在标记内,而不是仅仅嵌套在 AndroidManifest.xml 中的任何位置。

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="your.package.name">
<application>
    <activity android:name=".MainActivity">
        <!-- ... other configurations ... -->

        <!-- Intent filter for handling deep links -->
        <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />

            <!-- Accepts URIs that begin with "https://www.example.com/gizmos" -->
            <data
                android:scheme="https"
                android:host="www.example.com"
                android:pathPrefix="/gizmos" />
        </intent-filter>
    </activity>

    <!-- ... other activities ... -->
</application>

关于android - 创建 flutter 的深层链接时显示此错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/77435492/

相关文章:

java - 如何使用 GPUImage 库 "subtract"滤色器?

flutter - 修复底部空间的小部件

react-native - react native 导航: Deep link events not being fired when Tabs and Side Drawer are reloaded

android - 在 ActionBarSherlock 中按下刷新按钮时如何显示不确定的进度条?

android - 在真实设备上使用 Eclipse 调试 Android 应用程序

flutter - 读取列表中的元素以使卡片小部件变得困惑

flutter - dartdoc 失败 : Top level package requires Flutter but FLUTTER_ROOT environment variable not set

ios - Firebase 动态链接不会从 iOS 中的 facebook 帖子导航到 ios app/appstore

jquery - 使用 Wordpress 时如何从侧边栏导航深层链接到 jQuery-UI Accordion 项目?

java - 读取 SSL 证书时 X509Certificate.getSubjectDN()' 出现空指针异常