react-native-webrtc / react-native-callkeep

iOS CallKit framework and Android ConnectionService for React Native
ISC License
919 stars 444 forks source link

Change a firebase push notification to an incoming call #453

Open timorss opened 3 years ago

timorss commented 3 years ago

Bug report

Description

I'm struggling to change a firebase push notification to an incoming call. Is it even possible? Do I have to change the android or ios native code? Thanks.

Steps to Reproduce

Versions

- Callkeep:
- React Native:
- iOS:
- Android:
- Phone model: 

Logs

Paste here
timorss commented 3 years ago

well i manged to wake app the app when there is a call, but only on android with fire base. but firebase doesn't work with ios, any idea?

manuquentin commented 3 years ago

Hi @timorss, To be able to wake up an iOS device, you have to send a VOIP push notification

vohoangankhanh commented 3 years ago

well i manged to wake app the app when there is a call, but only on android with fire base. but firebase doesn't work with ios, any idea?

can you share your solution for android, thanks

timorss commented 3 years ago

well i manged to wake app the app when there is a call, but only on android with fire base. but firebase doesn't work with ios, any idea?

can you share your solution for android, thanks

In the index file

const answerCall = (data: any) => { console.log('answer call'); const { callUUID } = data; RNCallKeep.setCurrentCallActive(callUUID); RNCallKeep.backToForeground() RNCallKeep.endCall(callUUID);

navigate('chime', { data: { meetingToken: callUUID } })

};

RNCallKeep.addEventListener('answerCall', answerCall);

messaging().setBackgroundMessageHandler(async remoteMessage => { RNCallKeep.displayIncomingCall(remoteMessage.data.meetingToken, '1234', 'title'); });

for ios it doesn't work.