react-native-webrtc / react-native-callkeep

iOS CallKit framework and Android ConnectionService for React Native
ISC License
876 stars 429 forks source link

I want to redirect into my application when user accept call. not to native calling screen #308

Open saurabh874 opened 3 years ago

saurabh874 commented 3 years ago

Hi I am using react-native v-0.61.4 with react-native-callkeep. is there anyway to redirect into own application when user accept call. not to native calling screen?

samad324 commented 3 years ago

yes, use RNCallKeep.backToForeground();(Android only) method. this method will bring your app on the top of the native call screen.

saurabh874 commented 3 years ago

@samad324 thanks but in iOS. it always open native call kit. when app is in back-ground or kill state. do you have any idea how to resolve it and will it be possible to remove native call screen when accept a call?

samad324 commented 3 years ago

add answerCall listener in your app and redirect on your call screen. it will automatically direct you on your app.

 RNCallKeep.addEventListener('answerCall', async ({callUUID}) => {
     this.props.navigation.navigate('Video');
});
saurabh874 commented 3 years ago

but it is not working when app is in kill mode or phone locked.

samad324 commented 3 years ago

ohh.. my app is working fine when app is killed, but yes i'm facing the issue when phone is locked. and trying to resolve it as well. Kindly comment here if you will find any solution.

saurabh874 commented 3 years ago

Sure @samad324

samad324 commented 3 years ago

@saurabh874 hi, i saw the behaviour of the WhatsApp and Skype on lock screen, and they behaved same. if you want see your app you need to unlock your device.

agamsps commented 3 years ago

Any update @samad324 ? I am still facing this issue. I receive a push on locked ios, slide to answer, enter the passcode and the app does not opens. TIA

samad324 commented 3 years ago

Sorry, @agamsps , I got switched to another project and I don't know how they handle this.

namnm commented 3 years ago

When phone is locked, there's no way to open app directly from PN. https://stackoverflow.com/questions/41740139

There will be an icon in the native dialer, if user click on that icon, the phone will show unlock screen and if user unlock the phone, app will be shown. There's a config imageName when you setup CallKeep, which map to the objective C iconTemplateImageData to customize the image of that icon.

gabrielelana commented 2 years ago

@agamsps see my solution in last comment of #355

namnm commented 2 years ago

@gabrielelana Great info. Thanks for sharing

fukemy commented 1 year ago

@samad324 I can not bring to my call screen in case app killed. I dont know why, can not debug with app killed. Other case work fine, can u help?

Doma-byte commented 2 weeks ago

If app is in foreground and in background then navigation works perfectly, but the issue reside when app has been killed by user. Using fcm i trigger the callkeep UI with setbackgroundhandler but after accepting the call it's just navigate to native callUI screen not the app. Did anyone solve this issue?