【问题标题】:Deferred Deep Linking in iOS using Branch.io in a React Native App在 React Native 应用程序中使用 Branch.io 在 iOS 中延迟深度链接
【发布时间】:2020-08-05 17:33:23
【问题描述】:

我们使用 Branch.io 在我们的分支中实现了延迟深度链接。该流程在我们的 Android 版本中正常工作,但在 iOS 中不正常。单击 iOS 设备中的深层链接时,应用程序已正确安装,但我们的深层链接的延迟内容部分不起作用。 branch validate gem 是绿色的。

相关代码为:

branch.subscribe(async ({ error, params, uri }) => {
  if (error) {
    console.error(`Error from Branch: ${error}`);
    return;
  }

  if (params['+non_branch_link']) {
    return;
  }

  if (!params['+clicked_branch_link']) {
    return;
  }

  const deepLink = params.$deeplink_path;
  if (deepLink) {
    Linking.openURL(deepLink).catch((e) => { console.log('[Branch Error]', e); });
  }
});

【问题讨论】:

    标签: react-native branch.io


    【解决方案1】:

    用现有的范式永远无法解决这个问题。最后只是在我的 if 块内设置状态,如果设置了状态,则将用户重定向到错误的屏幕上。一定是某种竞争条件。

    ¯\ (ツ)

    【讨论】:

      【解决方案2】:

      您是否尝试将 initSessionTtl 时间设置为大约 10 秒?

      componentDidMount() {
          branch.initSessionTtl = 10000;
          branch.subscribe(({ error, params, uri }) => {
              //Handle the deep link here
          });
      }
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2018-10-19
        • 1970-01-01
        • 2020-05-14
        • 2014-11-09
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多