DeepLink仅在JetPack Navigation中使用斜线时起作用
我正在尝试使用 < nav-graph>
发电机以生成< intent-filter>
我的androidmanifest.xml <
elements.xml < /code>
在我的nav_graph.xml
中的片段之一中,我补充说:
<deepLink app:uri="axzae://notifications" />
在生成的apk中, androidManifest.xml
现在看起来像是下面的
<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:scheme="axzae" />
<data android:host="notifications" />
<data android:path="/" />
</intent-filter>
,问题在于附加android:path =“/”
。 应用程序仅响应axzae:// notifications/
而不是axzae:// notifications
(请注意结束斜线)
它使该 >&lt; nav-graph&gt; 支持axzae:// notifications
deeplink或不生成&lt;数据android:path =“/”/&gt;
line?
I'm trying to use <nav-graph>
generator to generate <intent-filter>
elements in my AndroidManifest.xml
In one of the fragments in my nav_graph.xml
, I added:
<deepLink app:uri="axzae://notifications" />
In the generated APK, the AndroidManifest.xml
looks like below
<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:scheme="axzae" />
<data android:host="notifications" />
<data android:path="/" />
</intent-filter>
Now, the problem is with the additional android:path="/"
. It made the app only respond to axzae://notifications/
but not axzae://notifications
(take note of the ending slash)
Is there anywhere I can make <nav-graph>
to support axzae://notifications
deeplink or without generating the <data android:path="/" />
line?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
显然,JetPack导航无法解析生成的
axzae:// notifications/
。该应用程序已启动,但它将始终打开您的StartDestination
。所以它实际上是破碎的。要注意的另一件事是,对于第二层深链接,它可以正常工作。示例
axzae:// Notifications/settings
将正常工作。我将通过手动在
androidmanifest.xml
中手动填充TLD/HOST-host-host-host-host-form-host-host-host-host-host-host-the Deep链接来求助于解决方法。apparently, jetpack navigations can't resolve the generated
axzae://notifications/
. the app launched but it will always open up yourstartDestination
. so it's actually broken.another thing to note is it works fine for second-layer deep links. Example
axzae://notifications/settings
will work fine.I will resort to a workaround for now by manually populating the TLD/host-only deep links in
AndroidManifest.xml