"react": "18.2.0",
"react-native": "0.71.12",
"@sendbird/calls-react-native": "1.0.2",
"react-native-callkeep": "^4.3.12",
"react-native-voip-push-notification": "^3.3.2",
버전 정보는 이렇고
import RNCallKeep from 'react-native-callkeep';
import RNVoipPushNotification from 'react-native-voip-push-notification';
SendbirdCalls.setListener({
async onRinging(callProps) {
const directCall = await SendbirdCalls.getDirectCall(callProps.callId);
// handle incoming call with CallKit (react-native-callkeep)
RNCallKeep.addEventListener('answerCall', async () => {
directCall.accept();
});
RNCallKeep.addEventListener('endCall', async () => {
directCall.end();
});
const unsubscribe = directCall.addListener({
onEnded() {
RNCallKeep.removeEventListener('answerCall');
RNCallKeep.removeEventListener('endCall');
RNCallKeep.endAllCalls();
unsubscribe();
},
});
RNCallKeep.displayIncomingCall(
callProps.ios_callUUID,
callProps.remoteUser?.userId,
callProps.remoteUser?.nickname ?? 'Unknown',
'generic',
callProps.isVideoCall,
);
}
});
RNVoipPushNotification.registerVoipToken();
ios는 위에 코드처럼
import messaging, { FirebaseMessagingTypes } from '@react-native-firebase/messaging';
SendbirdCalls.setListener({
async onRinging(callProps) {
const directCall = await SendbirdCalls.getDirectCall(callProps.callId);
// handle incoming call with what you want (e.g. Notifee foreground service)
}
});
const firebaseListener = async (message: FirebaseMessagingTypes.RemoteMessage) => {
SendbirdCalls.android_handleFirebaseMessageData(message.data);
};
messaging().setBackgroundMessageHandler(firebaseListener);
messaging().onMessage(firebaseListener);
android는 위에 코드처럼 적용을 하였는데
onRinging 에서 call이 오질 않습니다 무슨 이유 때문 일까요 ?
추가로 설정해주어야 하는 부분이 있는 걸까요 ?
참고로 initialize 하고 authenticate 까지 한 상태입니다