hyochan / react-native-audio-recorder-player

react-native native module for audio recorder and player.
MIT License
715 stars 213 forks source link

No audio sound work when phone is in silent mode #363

Open Somtozech opened 3 years ago

Somtozech commented 3 years ago

Version of react-native-audio-recorder-player

3.1.1

Version of React Native

0.63.0

Platforms you faced the error (IOS or Android or both?)

IOS

Expected behavior

When the phone is in silent mode, When I play audio, It should play out audio sound

Actual behavior

When my phone is in silent mode, No audio is played out till I switch to ring mode on iPhone

Steps to reproduce the behavior

Play the audio on your iPhone when in silent mode

manish-diligentic commented 2 months ago

I also faced same issue. I am using react-native-stream-chat lib which uses react-native-audio-recorder-player lib under the hood . In chat screen I got this issue.

manish-diligentic commented 2 months ago

This solution works for me. Try this. You can handle this natively in AppDelegate.m.

  1. Import AVFoundation

    import <AVFoundation/AVFoundation.h>

  2. Add this to the end of your didFinishLaunchingWithOptions function, right before the return YES;