如何从branch.io中的身份访问Branch Identity ID [英] How can I access Branch Identity ID from identities from branch.io

查看:123
本文介绍了如何从branch.io中的身份访问Branch Identity ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 https://github.com/BranchMetrics/branch- deep-linking-public-api 为我的用户创建分支链接



我是能够成功创建链接,也可以正常工作。但是我的链接缺少一个主要数据,即分支身份ID 。这是分支ID 分支



我也了解,如果我在创建链接时在 $ identity_id 标记中传递值,那么我就能在链接中看到分支身份ID 。但是我不知道如何访问此ID。



这是我的代码。

  const sendBranchRequest = params => {
const {path,body,qs,method} =参数;
const选项= {
方法
,uri:`$ {baseUrl} / $ {path}`
,标头:{
Content-Type: application / json
, Cache-Control: no-cache
}
,json:true
};

if(body){
options.body = body
options.body.branch_key = branchKey;
options.body.branch_secret = branchSecret;
}

return rp(options);
};

const createLink = data => {
const params = {
正文:{data}
,方法:‘POST’
,路径:‘url’
};
return sendBranchRequest(params);
};

预先感谢。

解决方案

分支身份ID 是内部的分支用户标识符,与每个用户相关联。您将无法直接使用Branch Identity ID创建链接。



您可以尝试使用Branch Developer身份创建分支链接,即可以使用的自定义身份来跟踪/识别您的用户。



以下是示例卷曲:

  curl -X POST \ 
\
-H Content-Type:application / json \
\
-d'{ branch_key: < you app key>,
广告系列:用户身份,频道:测试,
identity: YOUR_IDENTITY,//在此处设置您的自定义用户身份
data: {\ var1\:\ abcd\,
\ var2\:\ defg\
} }'\
\
https://api.branch.io/v1/url

一旦您创建了带有身份的链接,如果没有与该身份相关联的identity_id(分支身份ID),我们将创建一个新的(否则将其绑定到现有的identity_id)。

I am using https://github.com/BranchMetrics/branch-deep-linking-public-api to create a branch link for my users.

I am able to create link successfully which also works fine. But my link is missing one major data which is Branch Identity ID. This is the Branch ID associated with individual identities on Branch

I also understood that if I pass value in $identity_id tag while creating link then I will be able to see Branch Identity ID with my link. But I don't know how to access this id.

Here is my code.

const sendBranchRequest = params => {
    const { path, body, qs, method } = params;
    const options = {
        method
        , uri: `${ baseUrl }/${ path }`
        , headers: {
            "Content-Type": "application/json"
           , "Cache-Control": "no-cache"
          }
        , json: true
    };

    if ( body ) {
        options.body = body
        options.body.branch_key = branchKey;
        options.body.branch_secret = branchSecret;
    }

    return rp( options );
};

const createLink = data => {
    const params = {
        body: { data }
        , method: 'POST'
        , path: 'url'
    };
    return sendBranchRequest( params );
};

Thanks in advance.

解决方案

The Branch Identity ID is an internal Branch user identifier, associated with each user. You will not be able to use the Branch Identity ID directly to create links.

You can instead try to create Branch links using Branch Developer Identity i.e. a custom identity you can use to track/identify your users.

Here is a sample curl:

curl -X POST \
\
-H "Content-Type: application/json" \
\
-d '{"branch_key":"<you app key>", 
"campaign":"user identity", "channel":"test", 
"identity":"YOUR_IDENTITY", //set your custom user identity here
"data":"{\"var1\": \"abcd\", 
    \"var2\": \"defg\"
}"}' \
\
https://api.branch.io/v1/url

Once, you create a link with the identity, if there is no identity_id (Branch Identity ID) associated with the identity, we'll create a new one (otherwise tie it to an existing identity_id).

这篇关于如何从branch.io中的身份访问Branch Identity ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆