React native 世博会';s Branch.subscribe()未触发

React native 世博会';s Branch.subscribe()未触发,react-native,expo,branch.io,React Native,Expo,Branch.io,单击由Branch.io生成的deeplink时,我无法获取Branch.subscribe触发器。deeplink打开应用程序(我的应用程序),这很好,但是任何具有相同模式的链接(我的应用程序)都可以这样做。所以我不能确认Expo的分支机构是否真的在使用Android 我尝试了一些变化。从世博会的例子开始: componentDidMount() { logger('COMPONENT MOUNTED') // runs DangerZone.Branch.subscribe(

单击由Branch.io生成的deeplink时,我无法获取Branch.subscribe触发器。deeplink打开应用程序(我的应用程序),这很好,但是任何具有相同模式的链接(我的应用程序)都可以这样做。所以我不能确认Expo的分支机构是否真的在使用Android

我尝试了一些变化。从世博会的例子开始:

componentDidMount() {
    logger('COMPONENT MOUNTED') // runs
    DangerZone.Branch.subscribe((bundle) => {
      logger('PLS WORK') // doesn't run
    });
  }
}
  _unsubscribeFromBranch = null
  componentDidMount() {
    logger('COMPONENT MOUNTED') // runs
    _unsubscribeFromBranch = DangerZone.Branch.subscribe(({error, params}) => {
      logger('PLS WORK') // doesn't run
    })
  }

  componentWillUnmount() {
    if (_unsubscribeFromBranch) {
      _unsubscribeFromBranch()
      _unsubscribeFromBranch = null
    }
  }
分支机构的例子:

componentDidMount() {
    logger('COMPONENT MOUNTED') // runs
    DangerZone.Branch.subscribe((bundle) => {
      logger('PLS WORK') // doesn't run
    });
  }
}
  _unsubscribeFromBranch = null
  componentDidMount() {
    logger('COMPONENT MOUNTED') // runs
    _unsubscribeFromBranch = DangerZone.Branch.subscribe(({error, params}) => {
      logger('PLS WORK') // doesn't run
    })
  }

  componentWillUnmount() {
    if (_unsubscribeFromBranch) {
      _unsubscribeFromBranch()
      _unsubscribeFromBranch = null
    }
  }
subscribe()调用中的记录器从不触发。应用程序在deeplink url上打开,componentDidMount()运行,但subscribe不会对链接做出反应

我正在使用Expo的分支实现(Expo v25,react native Branch 2.0.0-beta.3)。如果可能的话,我想避免脱离世博会

ADB记录的其他错误:

04-04 11:41:42.319 30352 30352 E i       : java.lang.ClassNotFoundException: abi25_0_0.host.exp.exponent.modules.api.branch.RNBranchModule
04-04 11:41:42.319 30352 30352 E i       : Runtime exception in RNObject when calling method initSession: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.reflect.Method[] java.lang.Class.getMethods()' on a null object reference

分支似乎未正确初始化。您能确认您已将其与此报表一起导入吗

import { DangerZone } from 'expo';
let { Branch } = DangerZone;

React本机分支现在在版本2.2.4上。自beta版以来,我们对包装器进行了多次更新。您可以升级到吗?

谢谢您的回复。我省略了我的示例中的导入,但它们是从世博会的DangerZone导入的。如果导入分支失败,我的应用程序应该会遇到错误,因为它试图使用未定义的变量。我们试图手动更新到最新的分支,但它也没有响应。如果我们强制更新,我不知道Expo是否能与Branch很好地协同工作。我很困惑为什么要使用DangerZone而不是
react native Branch
模块,这是因为Expo不能使用手动模块,这是解决方法吗?该模块需要
react native link react native Branch
。我认为需要
链接的模块需要分离。在一些地方,手动升级
package.json中的版本而不分离几乎没有问题,但我在这里无法做到这一点。