Skip to content
This repository has been archived by the owner on Aug 21, 2020. It is now read-only.

[iOS] Deactivating recording session if needed, on app background #325

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

arvindhsukumar
Copy link

In our app, we faced an issue where the recording indicator (the red status bar/icon) didnt go away when the app was in the background, even when it was not recording. Making this change fixed it.

Apple in fact recommends that apps that support background audio recording deactivate the recording session when recording is not happening, and they go into the background (reference).

Many apps never need to deactivate their audio session explicitly. Important exceptions include VoIP apps, turn-by-turn navigation apps, and, in some cases, playback and recording apps.

If an app supports background audio playback or recording, deactivate its audio session when entering the background if the app is not actively using audio (or preparing to use audio). Doing so allows the system to free up audio resources so that they may be used by other processes. It also prevents the app's audio session from being deactivated when the app process is suspended by the operating system (see AVAudioSessionInterruptionWasSuspendedKey).

@arvindhsukumar arvindhsukumar changed the title Deactivating recording session if needed, on app background [iOS] Deactivating recording session if needed, on app background Apr 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant