Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setSpeakerPhoneOn not working for incoming call Android #212

Open
easyscripter opened this issue Jan 30, 2023 · 6 comments
Open

setSpeakerPhoneOn not working for incoming call Android #212

easyscripter opened this issue Jan 30, 2023 · 6 comments

Comments

@easyscripter
Copy link

When il make incoming call and accept . il try setSpeakerPhoneOn but its not working.
But for outgoing call its working. I use sip js react-native webrtc and react native incall manager.

const onAccepted = (data: any) => { if (data && data.route === 'incoming') { setCallActive(true); setIsCalling(false); InCallManager.start({media: 'audio'}); RNCallKeep.setCurrentCallActive(currentCallUUID); } else if (data && data.route === 'outgoing') { RNCallKeep.setCurrentCallActive(currentCallUUID); setIsCalling(false); InCallManager.stopRingback(); } }

const handleSpeaker = (isSpeaker: boolean) => { InCallManager.setSpeakerphoneOn(isSpeaker); }

@edritech93
Copy link

same issue for me
I use Android 13

@icc-guerrero
Copy link

Same here. Is a Samsung device @edritech93?

@mariouzae
Copy link

Tested with Samsung and Oppo both Android 12 and it didn't work.

Neither setForceSpeakerphoneOn nor setSpeakerphoneOn is working. Looking at the logs, I see it update the defaultAudioMode but it didn't route the audio to the phone speaker.

setForceSpeakerphoneOn() flag: 1 updateAudioDeviceState: wired headset=false, BT state=HEADSET_UNAVAILABLE Device status: available=[EARPIECE, SPEAKER_PHONE], selected=SPEAKER_PHONE, user selected=SPEAKER_PHONE updateAudioDeviceState done

I'm calling the .start before trying to change the audio to the speaker.

@mariouzae
Copy link

If you are using RN-InCallManager in conjunction with RN-CallKeep, remember to call RNCallKeep.toggleAudioRouteSpeaker() after calling setForceSpeakerphoneOn(), for some reason the RNCallKeep has control if you have called the RNCallKeep.startCall() first.

@wilmxre
Copy link

wilmxre commented Nov 1, 2023

hey @mariouzae, does this work for you 100% of the time?

@elangovansword
Copy link

For me audio switch worked after adding permission in AndroidManifest.xml file

<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants