生成指向两个不同应用程序的 Branch IO 链接?

Generate Branch IO links to two different applications?

我在 Branch IO dashboard 中注册了两个不同的 iOS/Unity 应用程序(应用程序 A、应用程序 B)。 我想建立一个网页,我按下一个按钮并使用 Branch web API 生成一个分支 link (deep link) 到 App A。然后有第二个按钮将生成一个深入 link 应用程序 B.

这可能吗?

据我所知,当我们使用 "live key" 初始化 JS 分支库时,所有内容都映射 1:1 到应用程序:-

branch.init('key_live_YOUR_KEY_GOES_HERE');

如您所见,Branch.IO 文档代码示例在创建深度 link 时未指定应用程序:-

var linkData = {
  campaign: 'content 123',
  channel: 'facebook',
  feature: 'dashboard',
  stage: 'new user',
  tags: [ 'tag1', 'tag2', 'tag3' ],
  alias: '',
  data: {
    'custom_bool': true,
    'custom_int': Date.now(),
    'custom_string': 'hello',
    '$og_title': 'Title',
    '$og_description': 'Description',
    '$og_image_url':'http://lorempixel.com/400/400'
  }
};

branch.link(linkData, function(err, link) {
  console.log(link);
});

当 Unity 应用程序启动并且 Branch Unity sdk 在内部从 Branch.cs 设置密钥时,情况相同:-

_setBranchKey(BranchData.Instance.liveBranchKey);

在此之后,所有分支 link 的创建都是通过静态函数完成的,因此不可能 运行 它的多个实例。

据我在生成 links 时阅读 Branch 文档可以看出,没有办法指定您尝试定位的应用程序(除了 init 键)。所以它被锁定到一个应用程序。这是正确的还是有其他我还不知道的方法?

您可以直接使用 Branch API 调用而不是使用 Web SDK。请参阅 https://help.branch.io/developers-hub/docs/deep-linking-api#section-creating-a-deep-linking-url。 您可以通过更改 curl 命令中的 'Key' 来为多个应用程序生成链接。