jsierles / react-native-audio

Audio recorder library for React Native
MIT License
1.16k stars 539 forks source link

Handle interruptions on iOS when app is in foreground/background #328

Open julioxavierr opened 5 years ago

julioxavierr commented 5 years ago

Now by default, the recording will be paused when an interruption begins and resumed right after the interruption ends. Works when the app is in foreground/background. This behavior is set by default to match the behavior that happens when an interruption occurs on Android.

Also, it's possible to stop recording when an interruption occurs (on prepareRecording). In this case, the recording will be stopped and the session will be set to inactive. It's also possible to start another session after this (before, it was breaking the app because it wasn't handled properly).