点击动态链接时如何激活UTM参数

问题描述 投票:0回答:1

当我单击它时,我正在使用Firebase Dynamic链接,我在活动中获得了深层链接,但是如何在活动中获取UTM参数,如我如何获得深层链接

android firebase deep-linking
1个回答
0
投票

尝试以下代码获取UTM参数

        FirebaseDynamicLinks.getInstance()
                .getDynamicLink(getIntent())
                .addOnSuccessListener(this, new OnSuccessListener<PendingDynamicLinkData>() {
                    @Override
                    public void onSuccess(PendingDynamicLinkData pendingDynamicLinkData) {
                        Uri deepLink = null;
                        if (pendingDynamicLinkData != null) {
                            deepLink = pendingDynamicLinkData.getLink();
                        }
                        if (deepLink != null
                                && deepLink.getBooleanQueryParameter("utm_param1", false)) {
                            String utm_param1 = deepLink.getQueryParameter("utm_param1");
                        }
                    }
                });
© www.soinside.com 2019 - 2024. All rights reserved.