简体   繁体   English

获取动态链接,而不是深层链接 - Android 上的 Firebase 动态链接

[英]Get the dynamic link, not the deep link - Firebase Dynamic Links on Android

I have created a Firebase dynamic link, ex:我创建了一个 Firebase 动态链接,例如:

dynamic link: https://my.dynamic.link
deep link: https://my.deep.link

When someone visits that dynamic link it will either open my app if it's installed or open Google Play to install my app.当有人访问该动态链接时,它会打开我的应用(如果它已安装)或打开 Google Play 来安装我的应用。

I'm not creating dynamic links using the android app, but I need to add parameters to that same dynamic link, ex:我没有使用 android 应用程序创建动态链接,但我需要向同一个动态链接添加参数,例如:

https://my.dynamic.link/?p1=a&p2=b
https://my.dynamic.link/?p3=c
https://my.dynamic.link/?p5=e&p6=f

Now what I want is to retrieve the full dynamic link (not the deep link) within my android application.现在我想要的是在我的 android 应用程序中检索完整的动态链接(不是深层链接)。 Firebase docs gives a proper way to retrieve the deep link. Firebase 文档提供了一种检索深层链接的正确方法。 That's not what I want.那不是我想要的。

FirebaseDynamicLinks.getInstance()
    .getDynamicLink(getIntent())
    .addOnSuccessListener(this, new OnSuccessListener<PendingDynamicLinkData>() {
        @Override
        public void onSuccess(PendingDynamicLinkData pendingDynamicLinkData) {
            if (pendingDynamicLinkData != null) {
                pendingDynamicLinkData.getLink(); // --> https://my.deep.link 

                /*
                   what I want is the dynamic link with parameters
                   https://my.dynamic.link/?p1=a&p2=b
                */
            }
        }
    }
);

Is there a way to achieve this?有没有办法实现这一目标?

Get all links not possible, but the branch.io is a possible solution for your working.获取所有链接是不可能的,但 branch.io 是您工作的可能解决方案。 He get dynamic link in facebook, google ads etc. You get this:他在 facebook、google 广告等中获得动态链接。你会得到这个:

{
      "identity_id": "427469360685348303",
      "link": "https://example.app.link?%24identity_id=427469360685348303",
      "session_id": "429691081177874743",
      "data": {
        "$canonical_identifier": "item/1503684554354.28",
        "$canonical_url": "https://example.com/home?utm_campaign=test&deeplink=value",
        "$desktop_url": "http://example.com/home",
        "$identity_id": "427469360685348303",
        "$og_description": "My Content Description",
        "$og_image_url": "http://lorempixel.com/200/200/",
        "$og_title": "46D6D28E-0390-40E4-A856-BD74F34D24C8",
        "$publicly_indexable": 1,
        "+click_timestamp": 1503684563,
        "+clicked_branch_link": true,
        "+is_first_session": false,
        "+match_guaranteed": true,
        "custom": "blue",
        "random": "FE848A5B-78F7-42EC-A253-9F795FE91692",
        "added": "1503684554354.33",
        "~campaign": "new launch",
        "~channel": "facebook",
        "~creation_source": 3,
        "~feature": "sharing",
        "~id": 429691043152332059,
        "~referring_link": "https://example.app.link/X7OsnWv9TF",
        "~stage": "new person",
        "~tags": [
          "one",
          "two"
        ]
      }
    }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM