react-native-incall-manager
react-native-incall-manager copied to clipboard
iOS incomming call issue
I have a problem with incall manager , when iOS device has incomming webrtc call , the webrtc just transfer video , not voice In android , everything works , in iOS outgoing call works
I see in your readme Fix iOS audio shared instance singleton conflit with internal webrtc.
is a TODO , is it relative to my issue?
@zxcpoiu can you help me?
No, it's not related. It just means that webrtc internally change audio category which may overrides our audio route preference, like we want it routes to EarPiece but be overridden to SpeakerPhone instead. The audio should plays as well but may in not preferred route.
I think you should simplify all your code down to pure webrtc, for example, use https://github.com/oney/RCTWebRTCDemo without bother incall manager and audio route first, to check where the problem lies on.
@zxcpoiu When I comment all codes related to react-native-incall-manager
I have no issue , and incomming/outgoing voice/video call from/to android/ios works well
I just use startRingtone('_DEFAULT_')
for incoming call, start({media: 'audio', ringback: '_BUNDLE_'})
for outgoing , InCallManager.stopRingtone()
,InCallManager.stop()
and InCallManager.stop({busytone: '_BUNDLE_'})
and nothing else
I know that startRingtone('_DEFAULT_')
is problem , When I just comment startRingtone('_DEFAULT_')
everything works , but when startRingtone('_DEFAULT_')
commented out , incomming call to iOS is an issue and there is no voice (But video) transfer
@zxcpoiu I found that the issue is InCallManager.stopRingtone()
not startRingtone('_DEFAULT_')
I comment InCallManager.stopRingtone()
and uncomment startRingtone('_DEFAULT_')
, Next , In call , in both side we hear ringtone and our voice
Hmm...I'm kind of lost. So, what exactly step you have this issue?
InCallManager.stopRingtone()
is supposed to be called after InCallManager.startRingtone('_DEFAULT_')
And during a call, there should have no ringtone
related function calls.
I am using redux middleware to manage ringtone
InCallManager.startRingtone('_DEFAULT_')
is executed when new incoming call received
I found that if I call InCallManager.stopRingtone()
then getUserMedia
, your library has no conflict with webrtc library , and both android and iOS works well
But if you call getUserMedia
then InCallManager.stopRingtone()
we have issue just in iOS not android
I am experiencing the same issue. However I can getUserMedia in the very beginning before I even make the call, so I am currently unable to find a workaround form this issue. I will keep digging
Same problem !!
What if you invoke start
when call is picked up?
ex:
StartRingtone()
getUserMedia()
StopRingtone() # --- after getUserMedia, conflict!
start() # --- invoke start() to see what happen, does it works normally?
I think this issue lines on that AudioSession is a singleton, and startRingtone / stopRingtone saved your original AudioSession category and restored them at the end.
If this is the case, the workaround would be: keep track and override AudioSession Mode and Category in your app logics, rely on your app logic, not this plugin nor webrtc.
Hello !
I'm facing kind of same issue there, when I call stopRingtone, it seems it cut all incoming sound from calls. I'm not using this library for calls, but when I call stopRingtone, I'm unable to receive sound from my caller. It's like all sound are cut, but only on IOs. Android works good.
If someone have info, I'm not yet enough experimented to fix objective-c and swift issues, but if someone is available, feel free to answer :)
Sincerely, Florient
hi @sm2017 , can u guide me how to using RNInCallManager.start function? I have using with RNCallKeep, it's already using configAudioSession with incomming call, so can I using start() function for incoming call case?
Has a solution been found for this iOS audio issue? I am facing the same issue, for me everything works fine for the first time, but second time audio is not working for both users.
this work to me:
InCallManager.start({media: isVideo ? 'video' : 'audio', ringback: '_BUNDLE_'})
getUserMedia()
in my case I just needed to call stopRingtone before setting remote description and create answer
`async function processAccept() { setType('CALLING_ROOM'); InCallManager.stopRingtone();
peerConnection.current
.setRemoteDescription(new RTCSessionDescription(remoteRTCMessage.current))
.then(() => {
pendingCandidates.forEach(candidate => {
peerConnection.current
.addIceCandidate(candidate)
.then(() => {
console.log('SUCCESS');
})
.catch(err => {
console.log('Error', err);
});
});
// Clear the candidates list
pendingCandidates = [];
})
.catch(error => {
console.log('Error in setting remote description', error);
});
const sessionDescription = await peerConnection.current.createAnswer();
await peerConnection.current.setLocalDescription(sessionDescription);
answerCall({
callerId: otherUserId.current,
rtcMessage: sessionDescription,
});
setCallingList(callData);
}`
I call this function when user press accept call button , may it helps to you guys