많은 게시물과 기사를 읽었으며 iPhone이 조용 할 때 운이 좋으면 오디오를 재생할 수 없습니다. 후드 아래 AVAudioPlayer
을 사용하는 react-native-sound
을 사용하고 있습니다. 다음 호출은 소리없이 들어올 때 운이 없으면 성공합니다.iPhone : 무음 모드에서 소리 재생 iOS 10
NSError *setCategoryError = nil;
BOOL success = [audioSession setCategory:AVAudioSessionCategoryPlayback error:&setCategoryError];
if (!success) { /* handle the error condition */ }
NSError *activationError = nil;
success = [audioSession setActive:YES error:&activationError];
if (!success) { /* handle the error condition */ }
의견이 있으십니까?
자료 : 나뿐만 아니라이 고민하고 https://developer.apple.com/library/content/qa/qa1668/_index.html
달성하고자하는 목표는 무엇입니까? 휴대 전화가 자동 모드 일 때 오디오를 재생 하시겠습니까? – Lion
예. 전화기가 조용 해지면 소리를 재생하여 원하는 기능을 사용할 수 있습니다. –