从我的应用程序到 WhatsApp 的深度 link 共享导致我的应用程序位于打开的应用程序 (WhatsApp) 之上

Deep link shared from my app to WhatsApp causes my app to be ontop of the opening app (WhatsApp)

我正在使用 Branch.IO 深入 link 我的应用特定位置。

我的应用程序中有一个聊天功能,可以在深度 link 下正常工作。

问题是,当我将 link 复制到 Whatsapp 并打开应用程序时,当使用主页按钮关闭我的应用程序并返回到 whatsapp 时,它又返回到我的应用程序。

这种行为是 WhatsApp 独有的,因为我已经测试了 Telegram,并且那里没有出现问题。

这是我接收时的分支回调 activity -

private void initBranch() {
        Branch.getInstance().initSession((referringParams, error) -> {
            if (error == null && referringParams != null) {
                try {
                    String verteItemID = referringParams.getString(VerteItemID);
                    Intent intent = new Intent(this, ProductPageActivity.class);
                    intent.putExtra(VERTE_ITEM_ID, verteItemID);
                    intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
                    startActivity(intent);

                } catch (JSONException e) {
                    e.printStackTrace();
                }
            }
        }, getIntent().getData(), this);
    }

知道为什么这种行为是 WhatsApp 独有的吗?

已解决 - 我在清单

中的 activity(正在打开)中添加了 SINGLE_TOP 标志