来人啊,救命啊!
answerCall事件并不是只在安卓系统中触发的。当我们在Android上调用displayIncomingCall和来电显示时,当我们按下call end按钮时,endCall事件就会启动,但是当我们按下call-accept按钮时,它会停留在呼叫屏幕上,什么都不会发生。answerCall事件没有触发。
请你帮忙,我们已经试过所有的解决办法了,什么都没有用。
这是我的密码:
// Register background handler
messaging().setBackgroundMessageHandler(async remoteMessage => {
console.log('Message handled in the background!', remoteMessage);
const callUUID = uuid.v4().toLowerCase()
const number = String(Math.floor(Math.random() * 100000))
RNCallKeep.displayIncomingCall(callUUID, number, number, 'number', false);
// await Linking.openURL("awesome://");
DeviceEventEmitter.addListener("answerCall", (payload) => {
console.log('answerCall', payload); // it doesn't run here
});
});
AppRegistry.registerComponent(appName, () => App);
发布于 2022-05-10 08:43:34
这个非常有用的块,它帮助我实现。你可以试试这个
https://blog.theodo.com/2021/03/react-native-incoming-call-ui-callkeep/
发布于 2022-09-24 05:26:28
之外注册事件发射器
messaging().setBackgroundMessageHandler(async remoteMessage => {
//your call trigger code piece
})
RNCallKeep.addEventListener('answerCall', async ({ callUUID }) => {
RNCallKeep.endCall(callUUID);
RNCallKeep.backToForeground();
RootNavigation.navigate("Call", {callUUID});
});
https://stackoverflow.com/questions/71853828
复制相似问题