首页 > 解决方案 > 如果安装了应用程序,则使用带有谷歌播放链接的深度链接打开应用程序,否则打开商店

问题描述

假设我在商店中有我的应用程序的链接,如下所示:https ://play.google.com/store/apps/details?id=my.app.id

假设如果我的应用已安装,我想打开它,或者如果我的应用未安装,则让商店处理链接。

说我intent-filter这样说:

        <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="https"
                android:host="play.google.com"
                android:path="/store/apps/details?id=my.app.id" />
        </intent-filter>

快乐的情况是:

但。据我所知,链接的查询部分(“?”之后的部分)将不起作用。所以上面的代码无法解析到我的应用程序。因此,商店处理该链接。

如果我改为android:path="/store/apps/details,它仍然无法工作,因为感觉商店处理所有 play.google.com 链接

无论如何我可以让它工作吗?感谢您的时间

标签: androidgoogle-playdeeplink

解决方案


检查这个文档。这将是工作。 https://firebase.google.com/docs/dynamic-links


推荐阅读