【发布时间】:2019-03-09 13:05:38
【问题描述】:
我有一个无人认领的赏金来回答这个问题。如果有人能够提供符合我标准的有效答案,我将奖励他们。它不可见,因为赏金已过期,但我可以在事后奖励它一个可接受的答案。
我的应用设置了 Intent 过滤器,当我使用 Chrome 时,它可以根据需要工作。不幸的是,Firefox 并没有以同样的方式实现深度链接。当我在 Firefox 中点击一个链接时,它会在地址栏的末尾显示一个小 Android 图标。如果我点击它,它将在 Firefox 中打开我的应用程序 ,我不喜欢这种行为。使用 Chrome,它只是打开应用程序(在第一次提示您选择应用程序后)
更新:单任务不起作用,它具有resuming activity not being able to get the extras from the intent that launched it. 的令人发指的副作用
这不是其他深度链接 Firefox 问题(this、this、this、this、this、this 和 this)的重复,因为这些问题是关于如何让深层链接工作完全,而我了解深层链接在 Firefox 中的工作原理并且它们已经为我工作,但我想改变这种行为...... p>
我在问:如果可能的话,我如何通过 Firefox 的深层链接打开我的应用程序的现有实例,并让它的行为方式与 Chrome 相同?我不知道不想使用 iframe。
我已经实现了 http 和 https 意图过滤器,如下所示:
<!-- https -->
<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="myappurl"
android:pathPrefix="/myprefix"
android:scheme="https" />
</intent-filter>
<!-- http -->
<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="myappurl"
android:pathPrefix="/myprefix"
android:scheme="http" />
</intent-filter>
如果您要提供解决方案,请提供一个清晰的示例,其中包括代码应该在清单中的位置(如果有的话)以及副作用是什么(请参阅我上面的链接-singletask不适用于此)
【问题讨论】:
标签: firefox android-intent deep-linking android-deep-link