我已经在 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/