firefox - Android 深层链接 Firefox like Chrome

标签 firefox android-intent deep-linking android-deep-link

对于这个问题,我有一个无人认领的赏金。如果有人能够提供符合我标准的有效答案,我将奖励他们。它不可见,因为赏金已过期,但我可以在事后将其奖励为可接受的答案。

我的应用程序设置了 Intent 过滤器,当我使用 Chrome 时,它​​可以按需要工作。不幸的是,Firefox 并没有以同样的方式实现深层链接。当我在 Firefox 中点击链接时,它会在地址栏的末尾显示一个小 Android 图标。如果我点击它,它将在 Firefox 中打开我的应用程序,我不喜欢这种行为。使用 Chrome,它只需打开应用程序(在第一次提示您选择应用程序后)

更新:单任务 不起作用 它具有 resuming activity not being able to get the extras from the intent that launched it. 的令人发指的副作用

这不是其他深层链接 Firefox 问题( thisthisthisthisthisthis 和 |9 个问题)的重复,因为这些 6 个问题是关于如何得到这些深 6 个问题|1045|1045链接完全可以工作,而我了解深层链接在 Firefox 和 中的工作原理他们已经为我工作 ,但我想改变行为......

我在问:如果可能,我如何通过来自 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>

如果您要提供解决方案,请提供一个清晰的示例,其中包括有关代码应在 list 中的位置(如果有的话)以及副作用是什么的上下文(请参阅我上面的链接-singletask 不起作用为了这)

最佳答案

你必须把android:launchMode="singleTask"在您的事件标签下。

这可以防止打开多个实例。如果您的应用程序已经打开,它将启动它,否则它将创建一个新实例。

关于firefox - Android 深层链接 Firefox like Chrome,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55077642/

相关文章:

java - 将目录和文件从 res/raw 文件夹复制到 SD 卡 - android

ios - 是否可以将Facebook App Links与电子邮件一起使用并通过App Store安装?

javascript - Firebug 中神秘的 "Type Error: non-native scope object"

javascript - 仅当使用 Function.apply() 时,Firefox "Bad NPObject"swf 错误

java - 如何修复 Android-Studio 中 Uri-Path 的 "FileNotFoundException"(没有此类文件或目录)错误?

java - Android - 调用 "finish()"不会触发 onDestroy

ios - iOS 中的 Facebook 深层链接

electron - 在 Electron 应用程序中实现延迟深度链接

javascript - 如何解决不同浏览器上requestAnimationFrame中FPS不同的问题?

html - Firefox 3.5 颜色校正黑客?