iOS에서 webRTC를 사용하는 SDK를 사용하여 화상 통화를 허용하는 앱을 개발 중입니다.다른 VOIP 통화 (iOS)를 감지하는 방법은 무엇입니까?
의도 한 기능은 내 앱이 통화를 인스턴스화 한 후에 다른 통화가 인스턴스화되면 해당 통화가 종료 될 때까지 내 앱에서 내 통화에서 오디오를 음소거하도록하려는 경우 오디오가 복원됩니다.
예를 들어 WeChat 및 Facebook Messenger와 같은 VOIP 통화를하는 다른 전화를 검색하려는 문제가 발생했습니다.
WeChat의 경우 AVOudioSession의 공유 오디오 세션을 방해한다는 악용 사례를 해결했습니다. 이를 처리하는 코드는 다음과 같습니다.
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector
(audioSessionInterrupted:)
...
name:AVAudioSessionInterruptionNotification object:nil];
- (void) audioSessionInterrupted:(NSNotification*)notification
{
if(notification.name == AVAudioSessionInterruptionNotification)
{
NSDictionary* userInfo = notification.userInfo;
int result = userInfo[AVAudioSessionInterruptionTypeKey];
if(result == AVAudioSessionInterruptionTypeBegan)
{
[[AVAudioSession sharedInstance] setActive:NO error:nil];
[self setAudioEnabled:NO];
}
else if (result == AVAudioSessionInterruptionTypeEnded)
{
[[AVAudioSession sharedInstance] setActive:YES error:nil];
[self setAudioEnabled:YES];
}
}
}
그러나 Facebook 메신저의 경우이 메소드는 호출되지 않습니다. 필자는 WeChat이 공유 오디오 세션에 대한 독점적 인 액세스를 요구할 수 있으므로 (즉, 내 앱으로 오디오 세션을 중단시키는) Facebook 메신저가 오디오 믹싱을 선택하거나 통화가 인스턴스화 될 때 별도의 오디오 세션을 사용한다고 추측합니다. .
제 질문은 아마도 CallKit 프레임 워크를 사용하여 다른 VOIP 전화를 검색하는 또 다른 방법이 있습니까? 내 앱은 CallKit을 사용하여 수신 전화를 사용자에게 알리고 iOS 전화 로그에 발신/발신 통화를 기록합니다.