Hi,
I’m trying to create an app with Webrtc call.
The calls work perfectly, but I would like to set by default the audio output to phone speaker.
And if there is a bluetooth connection, switch audio on the bluetooth device.
For that I use react-native-incall-manager, on android everything works fine.
But on ios, only the first call works, after the sound doesn’t work anymore.
The problem is known, a solution was proposed but I do not know how to apply it.
opened 05:48AM - 15 Dec 20 UTC
HI.
I'm building an app and have some issue.
Here is my scenario.
```java… script
// Establish WebRTC Connection
InCallManager.start({ media: 'video', auto: true });
// Communicate through RTC Connection
// After all communications done
InCallManager.stop();
// Re-establish WebRTC Connection
InCallManager.start({ media: 'video', auto: true });
```
Here is problem.
When I re-establish the connection and start InCallManager again, the Audio doesn't works at all,
i.e. Mic input and Speaker output.
My assumption is due to IOS AVAudioSession, because WebRTC assumes that it's the only one controls AVAudioSession which is implemented as a singleton.
Am I right? and how can I fix it? (or do you have any plan for fixing it?)
React-Native-IncallManager Version : v3.3.0
libWebRTC : M84
I need a help, Thanks for reading me
Don’t use react-native-incall-manager on ios. Instead, just update the AVAudioSession directly from your ApplDelegate.m. Something like this:
#import <WebRTC/RTCAudioSessionConfiguration.h>
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
RTCAudioSessionConfiguration *webRTCConfiguration = [RTCAudioSessionConfiguration webRTCConfiguration];
webRTCConfiguration.categoryOptions = (AVAudioSessionCategoryOptionAllowBluetooth | AVAudioSessionCategoryOptionDefaultToSpeaker);
}
2 Likes