首页 > 解决方案 > 在来电时触发 RNCallKeep.displayIncomingCall() 的最佳方法是什么?

问题描述

现在,我可以在单击按钮后触发 RNCallKeep.displayIncomingCall() 并显示传入屏幕。目标是每当有来电时,通过传递来电者的号码来触发 RNCallKeep.displayIncomingCall()。我尝试使用 react-native-call-detection,我得到了号码,但它没有触发 RNCallKepp.displayIncomingCall():

this.callDetector = new CallDetectorManager((event, phoneNumber)=> {
    if (event === 'Incoming') {
    RNCallKeep.displayIncomingCall(
      'c5612146-3e43-4922-bdf2-13b0c2cb2243',
      phoneNumber,
      'CALLER NAME'
    );
    }
}

在来电时触发 RNCallKeep.displayIncomingCall() 的最佳方法是什么?

标签: react-nativeincoming-call

解决方案


推荐阅读